Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3217 Rev 3220
Línea 51... Línea 51...
51
          label='Valor'
51
          label='Valor'
52
          placeholder='Define el valor de la meta'
52
          placeholder='Define el valor de la meta'
53
          control={control}
53
          control={control}
54
          rules={{
54
          rules={{
55
            required: 'El valor es requerido',
55
            required: 'El valor es requerido',
-
 
56
            validate: {
56
            min: { value: 1, message: 'El valor debe ser mayor a 1' },
57
              positive: (value) => Number(value) > 0 || 'El valor mayor a cero',
-
 
58
              max: (value) =>
57
            max: { value: 100, message: 'El valor debe ser menor a 100' }
59
                Number(value) <= 100 || 'El valor debe ser menor o igual a 100'
-
 
60
            }
58
          }}
61
          }}
59
          error={errors.value?.message}
62
          error={errors.value?.message}
60
        />
63
        />
Línea 61... Línea 64...
61
 
64
 
62
        <Controller
65
        <Controller
63
          name='skill_id'
66
          name='skill_id'
64
          control={control}
-
 
65
          defaultValue={[]}
67
          control={control}
66
          rules={{ required: 'Selecciona al menos un hábito' }}
68
          rules={{ required: 'Selecciona al menos un hábito' }}
67
          render={({ field: { name, onChange } }) => (
69
          render={({ field: { name, onChange } }) => (
68
            <>
70
            <>
69
              <TagsInput
71
              <TagsInput
Línea 90... Línea 92...
90
              beGreaterThanToday: (value) =>
92
              beGreaterThanToday: (value) =>
91
                new Date(value) > new Date() ||
93
                new Date(value) > new Date() ||
92
                'La fecha debe ser mayor a la fecha actual'
94
                'La fecha debe ser mayor a la fecha actual'
93
            }
95
            }
94
          }}
96
          }}
95
          render={({ field: { onChange } }) => (
97
          render={({ field: { onChange, ref, value, name } }) => (
96
            <>
98
            <>
97
              <InputLabel>Fecha de inicio</InputLabel>
99
              <InputLabel>Fecha de inicio</InputLabel>
98
              <Datetime
100
              <Datetime
99
                dateFormat='DD-MM-YYYY'
101
                dateFormat='DD-MM-YYYY'
100
                onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
102
                onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
101
                timeFormat={false}
103
                timeFormat={false}
102
                inputProps={{ className: 'form-control' }}
104
                inputProps={{ className: 'form-control', ref, name }}
-
 
105
                value={value}
103
                closeOnSelect
106
                closeOnSelect
104
              />
107
              />
105
              {errors.start_date && (
108
              {errors.start_date && (
106
                <FormErrorFeedback>
109
                <FormErrorFeedback>
107
                  {errors.start_date?.message}
110
                  {errors.start_date?.message}
Línea 119... Línea 122...
119
              beGreaterThanStartDate: (value, { start_date }) =>
122
              beGreaterThanStartDate: (value, { start_date }) =>
120
                new Date(value) > new Date(start_date) ||
123
                new Date(value) > new Date(start_date) ||
121
                'La fecha debe ser mayor a la fecha de inicio'
124
                'La fecha debe ser mayor a la fecha de inicio'
122
            }
125
            }
123
          }}
126
          }}
124
          render={({ field: { onChange } }) => (
127
          render={({ field: { onChange, name, ref, value } }) => (
125
            <>
128
            <>
126
              <InputLabel>Fecha de finalización</InputLabel>
129
              <InputLabel>Fecha de finalización</InputLabel>
127
              <Datetime
130
              <Datetime
128
                dateFormat='DD-MM-YYYY'
131
                dateFormat='DD-MM-YYYY'
129
                onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
132
                onChange={(e) => onChange(e.format('YYYY-MM-DD'))}
130
                timeFormat={false}
133
                timeFormat={false}
131
                inputProps={{ className: 'form-control' }}
134
                inputProps={{ className: 'form-control', ref, name }}
-
 
135
                value={value}
132
                closeOnSelect
136
                closeOnSelect
133
              />
137
              />
134
              {errors.end_date && (
138
              {errors.end_date && (
135
                <FormErrorFeedback>
139
                <FormErrorFeedback>
136
                  {errors.end_date?.message}
140
                  {errors.end_date?.message}