Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3213 Rev 3214
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { Controller, useForm } from 'react-hook-form'
2
import { Controller, useForm } from 'react-hook-form'
3
import { Button } from '@mui/material'
3
import { Button, InputLabel } from '@mui/material'
4
import Datetime from 'react-datetime'
4
import Datetime from 'react-datetime'
Línea 5... Línea 5...
5
 
5
 
6
import Form from '@components/common/form'
6
import Form from '@components/common/form'
7
import Input from '@components/UI/inputs/Input'
7
import Input from '@components/UI/inputs/Input'
Línea 79... Línea 79...
79
        <Controller
79
        <Controller
80
          name='start_date'
80
          name='start_date'
81
          control={control}
81
          control={control}
82
          // rules={{ required: 'La fecha es requerida' }}
82
          // rules={{ required: 'La fecha es requerida' }}
83
          render={({ field: { onChange } }) => (
83
          render={({ field: { onChange } }) => (
-
 
84
            <>
-
 
85
              <InputLabel>Fecha de inicio</InputLabel>
84
            <Datetime
86
              <Datetime
-
 
87
                dateFormat='DD-MM-YYYY'
-
 
88
                onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
-
 
89
                timeFormat={false}
-
 
90
                inputProps={{ className: 'form-control' }}
-
 
91
                closeOnSelect
-
 
92
              />
-
 
93
              {errors.start_date && (
-
 
94
                <FormErrorFeedback>
-
 
95
                  {errors.start_date?.message}
-
 
96
                </FormErrorFeedback>
-
 
97
              )}
-
 
98
            </>
-
 
99
          )}
-
 
100
        />
-
 
101
        <Controller
-
 
102
          name='end_date'
-
 
103
          control={control}
-
 
104
          // rules={{ required: 'La fecha es requerida' }}
-
 
105
          render={({ field: { onChange } }) => (
-
 
106
            <>
-
 
107
              <InputLabel>Fecha de finalización</InputLabel>
-
 
108
              <Datetime
85
              dateFormat='DD-MM-YYYY'
109
                dateFormat='DD-MM-YYYY'
86
              onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
110
                onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
87
              timeFormat={false}
111
                timeFormat={false}
88
              inputProps={{ className: 'form-control' }}
112
                inputProps={{ className: 'form-control' }}
89
              closeOnSelect
113
                closeOnSelect
-
 
114
              />
-
 
115
              {errors.end_date && (
-
 
116
                <FormErrorFeedback>
-
 
117
                  {errors.end_date?.message}
-
 
118
                </FormErrorFeedback>
-
 
119
              )}
90
            />
120
            </>
91
          )}
121
          )}
92
        />
122
        />
Línea 93... Línea 123...
93
 
123
 
94
        <Button type='submit' color='primary'>
124
        <Button type='submit' color='primary'>