Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16704 Rev 16705
Línea 210... Línea 210...
210
    { placeholder: 'Por ejemplo: otro' }
210
    { placeholder: 'Por ejemplo: otro' }
211
  ]
211
  ]
Línea 212... Línea 212...
212
 
212
 
213
  const calculateMaxDate = () => {
213
  const calculateMaxDate = () => {
214
    const today = new Date()
214
    const today = new Date()
215
    const maxDate = today.setDate(today.getDate() + 30)
215
    const maxDate = today.setDate(today.getDate() + 29)
216
    return new Date(maxDate)
216
    return new Date(maxDate)
Línea -... Línea 217...
-
 
217
  }
-
 
218
 
-
 
219
  const calculateMinDate = () => {
-
 
220
    return new Date()
217
  }
221
  }
218
 
222
 
219
  const addOption = () => {
223
  const addOption = () => {
Línea 220... Línea 224...
220
    setOptionsNumber(optionsNumber + 1)
224
    setOptionsNumber(optionsNumber + 1)
Línea 287... Línea 291...
287
        </button>
291
        </button>
288
      )}
292
      )}
289
      <Datetime
293
      <Datetime
290
        value={selectedDate}
294
        value={selectedDate}
291
        onChange={setSelectedDate}
295
        onChange={setSelectedDate}
-
 
296
        isValidDate={(current) =>
-
 
297
          current.isBefore(calculateMaxDate()) &&
-
 
298
          current.isAfter(calculateMinDate())
292
        isValidDate={(current) => current.isBefore(calculateMaxDate())} // Se valida que la fecha sea antes de la fecha máxima
299
        } // Se valida que la fecha esté entre la fecha mínima y la fecha máxima
-
 
300
        timeConstraints={{
293
        placeholderText="Selecciona una fecha"
301
          hours: { max: 23 },
-
 
302
          minutes: { max: 59 }
-
 
303
        }}
294
      />
304
      />
295
    </>
305
    </>
296
  )
306
  )
297
}
307
}