Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1064 Rev 3021
Línea 14... Línea 14...
14
  })
14
  })
Línea 15... Línea 15...
15
 
15
 
16
  return months
16
  return months
Línea -... Línea 17...
-
 
17
}
-
 
18
 
-
 
19
export function getTimeDiff(segundos) {
-
 
20
  const currentDate = new Date()
-
 
21
  const futureDate = new Date(currentDate.getTime() + segundos * 1000)
-
 
22
  const diff = futureDate - currentDate
-
 
23
 
-
 
24
  const days = Math.floor(diff / (1000 * 60 * 60 * 24))
-
 
25
  const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
-
 
26
  const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))
-
 
27
 
-
 
28
  return `${addZero(days)}d ${addZero(hours)}h ${addZero(minutes)}m`
-
 
29
}
-
 
30
 
-
 
31
function addZero(unit) {
-
 
32
  return String(unit).padStart(2, '0')
17
}
33
}
18
 
34
 
19
const getMonthName = (monthNumber) => {
35
const getMonthName = (monthNumber) => {
Línea 20... Línea 36...
20
  const date = new Date()
36
  const date = new Date()