- magnitudes: {
- day: 86400000,
- hour: 3600000,
- minute: 60000,
- second: 1000
- },
- labels: {
- day: 'time.days',
- hour: 'time.hours',
- minute: 'time.minutes',
- second: 'time.seconds'
- },
-
- makeTimeReadable(time: number, magnitude: DateMagnitude): ReadableTime {
+ magnitudes: {
+ day: 86400000,
+ hour: 3600000,
+ minute: 60000,
+ second: 1000
+ },
+ labels: {
+ day: 'time.days',
+ hour: 'time.hours',
+ minute: 'time.minutes',
+ second: 'time.seconds'
+ },
- return {
- count: Math.floor(time / internals.magnitudes[magnitude]),
- label: internals.labels[magnitude]
- };
- }
+ makeTimeReadable(time: number, magnitude: DateMagnitude): ReadableTime {
+ return {
+ count: Math.floor(time / internals.magnitudes[magnitude]),
+ label: internals.labels[magnitude]
+ };
+ }
-
- switch (true) {
- case time >= internals.magnitudes.day:
- return internals.makeTimeReadable(time, 'day');
- case time >= internals.magnitudes.hour:
- return internals.makeTimeReadable(time, 'hour');
- case time >= internals.magnitudes.minute:
- return internals.makeTimeReadable(time, 'minute');
- case time < 0:
- return internals.makeTimeReadable(0, 'second');
- default:
- return internals.makeTimeReadable(time, 'second');
- }
+ switch (true) {
+ case time >= internals.magnitudes.day:
+ return internals.makeTimeReadable(time, 'day');
+ case time >= internals.magnitudes.hour:
+ return internals.makeTimeReadable(time, 'hour');
+ case time >= internals.magnitudes.minute:
+ return internals.makeTimeReadable(time, 'minute');
+ case time < 0:
+ return internals.makeTimeReadable(0, 'second');
+ default:
+ return internals.makeTimeReadable(time, 'second');
+ }