const ONE_HOUR_IN_MS = 3600 * 1000 ; const ONE_MINUTE_IN_MS = 60 * 1000 ; example export const getISODateString = ( date ) : string => { const year = `${ date . getFullYear ( ) }` ; const months = `0${ date . getMonth ( ) + 1 }` . replace ( /0(\d\d)/ , '$1' ) ; const days = `0${ date . getDate ( ) }` . replace ( /0(\d\d)/ , '$1' ) ; return `${ year }-${ months }-${ days }` ; } ; example export const getISOTimeString = ( date ) : string => { const hours = `0${ date . getHours ( ) }` . replace ( /0(\d\d)/ , '$1' ) ; const minutes = `0${ date . getMinutes ( ) }` . replace ( /0(\d\d)/ , '$1' ) ; return `${ hours }:${ minutes }` ; } ; export const convertMillisecondsToHours = ( ms ) : number => { return Math . floor ( ms / ONE_HOUR_IN_MS ) ; } ; export const convertMillisecondsToMinutes = ( ms ) : number => { return Math . floor ( ( ms % ONE_HOUR_IN_MS ) / ONE_MINUTE_IN_MS ) ; } ;