Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3320 | Rev 3325 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3320 Rev 3324
Línea 4... Línea 4...
4
import Form from '@components/common/form'
4
import Form from '@components/common/form'
5
import Input from '@components/UI/inputs/Input'
5
import Input from '@components/UI/inputs/Input'
6
import Button from '@components/UI/buttons/Buttons'
6
import Button from '@components/UI/buttons/Buttons'
7
import Ckeditor from '@components/common/ckeditor/Ckeditor'
7
import Ckeditor from '@components/common/ckeditor/Ckeditor'
8
import LoadingWrapper from '@components/common/loading-wrapper'
8
import LoadingWrapper from '@components/common/loading-wrapper'
-
 
9
import DatetimePicker from '@components/common/inputs/datetime-picker'
Línea 9... Línea 10...
9
 
10
 
10
function ProgressForm({
11
function ProgressForm({
11
  onSubmit = () => {},
12
  onSubmit = () => {},
12
  defaultValues = {
13
  defaultValues = {
Línea 22... Línea 23...
22
  } = useForm({
23
  } = useForm({
23
    defaultValues,
24
    defaultValues,
24
    values
25
    values
25
  })
26
  })
Línea 26... Línea 27...
26
 
27
 
27
  const getCurrentDate = () => {
28
  /* const getCurrentDate = () => {
28
    const date = new Date()
29
    const date = new Date()
29
    const year = date.getFullYear()
30
    const year = date.getFullYear()
30
    const month = String(date.getMonth() + 1).padStart(2, '0') // Enero es 0
31
    const month = String(date.getMonth() + 1).padStart(2, '0') // Enero es 0
31
    const day = String(date.getDate()).padStart(2, '0')
32
    const day = String(date.getDate()).padStart(2, '0')
32
    const hours = String(date.getHours()).padStart(2, '0')
33
    const hours = String(date.getHours()).padStart(2, '0')
33
    const minutes = String(date.getMinutes()).padStart(2, '0')
34
    const minutes = String(date.getMinutes()).padStart(2, '0')
34
    const seconds = String(date.getSeconds()).padStart(2, '0')
35
    const seconds = String(date.getSeconds()).padStart(2, '0')
35
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
36
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
Línea 36... Línea 37...
36
  }
37
  } */
37
 
38
 
38
  return (
39
  return (
-
 
40
    <Form onSubmit={handleSubmit(onSubmit)}>
-
 
41
      <LoadingWrapper loading={isSubmitting} displayChildren>
-
 
42
        <DatetimePicker
-
 
43
          label='Fecha'
-
 
44
          name='date'
-
 
45
          control={control}
-
 
46
          rules={{
-
 
47
            required: { value: true, message: 'La fecha es requerida' },
-
 
48
            validate: {
-
 
49
              beGreaterThanToday: (value) =>
-
 
50
                new Date(value) > new Date() ||
-
 
51
                'La fecha debe ser mayor a la fecha actual'
-
 
52
            }
-
 
53
          }}
-
 
54
          displayTime
-
 
55
          dateFormat='YYYY-MM-DDTHH:mm:ss'
39
    <Form onSubmit={handleSubmit(onSubmit)}>
56
        />
40
      <LoadingWrapper loading={isSubmitting} displayChildren>
57
 
41
        <Input
58
        <Input
42
          control={control}
59
          control={control}
43
          label='Valor cuantitativo:'
60
          label='Valor cuantitativo:'