export function msToMins ( value ) { return durationFromMsHelper ( value ) ; } function pad2 ( num ) { if ( num <= 99 ) { num = ( '0' + num ) . slice ( - 2 ) ; } return num ; } function durationFromMsHelper ( ms ) { let x = ms / 1000 ; const seconds = pad2 ( Math . floor ( x % 60 ) ) ; x /= 60 ; const minutes = pad2 ( Math . floor ( x % 60 ) ) ; x /= 60 ; const hours = Math . floor ( x % 24 ) ; const newHours = hours ? pad2 ( hours ) + ':' : '' ; return newHours + minutes + ':' + seconds ; }