2022-02-15 16:01:54 +00:00
|
|
|
const hours = (amount) => amount * minutes(60)
|
|
|
|
const minutes = (amount) => amount * seconds(60)
|
|
|
|
const seconds = (amount) => amount
|
|
|
|
|
2022-03-09 10:11:01 +00:00
|
|
|
const periodic = (length) => ({
|
|
|
|
periodOf: (timestamp) => Math.floor(timestamp / length),
|
|
|
|
periodStart: (period) => period * length,
|
|
|
|
periodEnd: (period) => (period + 1) * length,
|
|
|
|
})
|
|
|
|
|
2022-09-22 02:21:49 +00:00
|
|
|
module.exports = { hours, minutes, seconds, periodic }
|