Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16719 Rev 16720
Línea 238... Línea 238...
238
 
238
 
239
    if (selected) {
239
    if (selected) {
240
      const currentDate = new Date()
240
      const currentDate = new Date()
241
      const selectedDt = new Date(selected.format('YYYY-MM-DD'))
241
      const selectedDt = new Date(selected.format('YYYY-MM-DD'))
242
      const timeDiff = selectedDt.getTime() - currentDate.getTime()
242
      const timeDiff = selectedDt.getTime() - currentDate.getTime()
243
      const daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24))
-
 
244
      const hoursDiff = Math.floor(
243
      const daysDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24))
245
        (timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
-
 
246
      )
244
      const hoursDiff = Math.floor((timeDiff / (1000 * 60 * 60)) % 24)
247
      const minutesDiff = Math.floor(
-
 
248
        (timeDiff % (1000 * 60 * 60)) / (1000 * 60)
245
      const minutesDiff = Math.floor((timeDiff / (1000 * 60)) % 60)
249
      )
246
 
250
      setDaysDifference({
247
      setDaysDifference({
251
        days: daysDiff,
248
        days: daysDiff,
252
        hours: hoursDiff,
249
        hours: hoursDiff,
253
        minutes: minutesDiff
250
        minutes: minutesDiff