1 type DateMagnitude = 'day' | 'hour' | 'minute' | 'second';
19 minute: 'time.minutes',
20 second: 'time.seconds'
23 makeTimeReadable(time: number, magnitude: DateMagnitude): ReadableTime {
26 count: Math.floor(time / internals.magnitudes[magnitude]),
27 label: internals.labels[magnitude]
32 export const readableTime = function readableTime(time: number): ReadableTime {
35 case time >= internals.magnitudes.day:
36 return internals.makeTimeReadable(time, 'day');
37 case time >= internals.magnitudes.hour:
38 return internals.makeTimeReadable(time, 'hour');
39 case time >= internals.magnitudes.minute:
40 return internals.makeTimeReadable(time, 'minute');
42 return internals.makeTimeReadable(0, 'second');
44 return internals.makeTimeReadable(time, 'second');