mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 05:13:32 +00:00
refactor: unify time constants
This commit is contained in:
committed by
Carlos Valente
parent
119e6caca3
commit
d05cc88748
@@ -4,6 +4,9 @@ export const MILLIS_PER_SECOND = 1000;
|
||||
export const MILLIS_PER_MINUTE = 1000 * 60;
|
||||
export const MILLIS_PER_HOUR = 1000 * 60 * 60;
|
||||
|
||||
export const dayInMs = 86400000;
|
||||
export const maxDuration = dayInMs - MILLIS_PER_SECOND;
|
||||
|
||||
function convertMillis(millis: MaybeNumber, conversion: number) {
|
||||
if (!millis) {
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { dayInMs } from '../timeConstants';
|
||||
import { MILLIS_PER_HOUR } from './conversionUtils';
|
||||
import { dayInMs, MILLIS_PER_HOUR } from './conversionUtils';
|
||||
import { formatFromMillis, millisToString, removeLeadingZero } from './timeFormatting';
|
||||
|
||||
describe('millisToString()', () => {
|
||||
|
||||
Reference in New Issue
Block a user