This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @desc function to convert ms to time format hh:ii:ss.ms | |
* @param {Number} duration, time ini miliseconds | |
* @return {String} sample 00:01:01:99 | |
*/ | |
export function msToTime(duration = 0) { | |
let milliseconds = parseInt((duration % 1000) / 100), | |
seconds = Math.floor((duration / 1000) % 60), | |
minutes = Math.floor((duration / (1000 * 60)) % 60), | |
hours = Math.floor((duration / (1000 * 60 * 60)) % 24); |
OlderNewer