Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3226 Rev 3227
Línea 19... Línea 19...
19
  const {
19
  const {
20
    control,
20
    control,
21
    handleSubmit,
21
    handleSubmit,
22
    formState: { errors, isSubmitting }
22
    formState: { errors, isSubmitting }
23
  } = useForm({
23
  } = useForm({
24
    defaultValues,
24
    defaultValues: {
-
 
25
      start_date: new Date()
-
 
26
    },
25
    values,
27
    values,
26
    mode: 'all'
28
    mode: 'all'
27
  })
29
  })
Línea 28... Línea 30...
28
 
30
 
Línea 112... Línea 114...
112
              )}
114
              )}
113
            </>
115
            </>
114
          )}
116
          )}
115
        />
117
        />
Línea 116... Línea 118...
116
 
118
 
117
        {/* <Controller
119
        <Controller
118
          name='end_date'
120
          name='end_date'
119
          control={control}
121
          control={control}
120
          rules={{
122
          rules={{
121
            required: { value: true, message: 'La fecha es requerida' },
-
 
122
            validate: {
123
            required: { value: true, message: 'La fecha es requerida' },
123
              beGreaterThanStartDate: (value, { start_date }) =>
124
            validate: (value, { start_date }) =>
124
                new Date(value) > new Date(start_date) ||
125
              new Date(value) > new Date(start_date) ||
125
                'La fecha debe ser mayor a la fecha de inicio'
-
 
126
            }
126
              'La fecha debe ser mayor a la fecha de inicio'
127
          }}
127
          }}
128
          render={({ field: { onChange, name, ref, value } }) => (
128
          render={({ field: { onChange, name, ref, value } }) => (
129
            <>
129
            <>
130
              <InputLabel>Fecha de finalización</InputLabel>
130
              <InputLabel>Fecha de finalización</InputLabel>
Línea 141... Línea 141...
141
                  {errors.end_date?.message}
141
                  {errors.end_date?.message}
142
                </FormErrorFeedback>
142
                </FormErrorFeedback>
143
              )}
143
              )}
144
            </>
144
            </>
145
          )}
145
          )}
146
        /> */}
146
        />
Línea 147... Línea 147...
147
 
147
 
148
        <Button type='submit' color='primary'>
148
        <Button type='submit' color='primary'>
149
          Enviar
149
          Enviar
150
        </Button>
150
        </Button>