Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3384 Rev 3385
Línea 81... Línea 81...
81
              rules={{
81
              rules={{
82
                required: { value: true, message: 'La fecha es requerida' },
82
                required: { value: true, message: 'La fecha es requerida' },
83
                validate: {
83
                validate: {
84
                  beEqualOrGreaterThanToday: (date) => {
84
                  beEqualOrGreaterThanToday: (date) => {
85
                    const selectedDate = new Date(date + 'T00:00:00')
85
                    const selectedDate = new Date(date + 'T00:00:00')
86
                    const today = new Date()
86
                    const selectedDateMs = selectedDate.getTime()
87
                    today.setHours(0, 0, 0, 0)
87
                    const todayMs = new Date().setHours(0, 0, 0, 0)
Línea 88... Línea 88...
88
 
88
 
89
                    return (
89
                    return (
90
                      selectedDate >= today ||
90
                      selectedDateMs >= todayMs ||
91
                      'La fecha debe ser mayor o igual a hoy'
91
                      'La fecha debe ser mayor o igual a hoy'
92
                    )
92
                    )
93
                  }
93
                  }
94
                }
94
                }
Línea 102... Línea 102...
102
              rules={{
102
              rules={{
103
                required: { value: true, message: 'La fecha es requerida' },
103
                required: { value: true, message: 'La fecha es requerida' },
104
                validate: (value, { start_date }) => {
104
                validate: (value, { start_date }) => {
105
                  const startDate = new Date(start_date + 'T00:00:00')
105
                  const startDate = new Date(start_date + 'T00:00:00')
106
                  const endDate = new Date(value + 'T00:00:00')
106
                  const endDate = new Date(value + 'T00:00:00')
-
 
107
                  const startDateMs = startDate.getTime()
-
 
108
                  const endDateMs = endDate.getTime()
Línea 107... Línea 109...
107
 
109
 
108
                  return (
110
                  return (
109
                    endDate >= startDate ||
111
                    endDateMs > startDateMs ||
110
                    'La fecha debe ser mayor o igual a la fecha de inicio'
112
                    'La fecha debe ser mayor a la fecha de inicio'
111
                  )
113
                  )
112
                }
114
                }
113
              }}
115
              }}