-
Notifications
You must be signed in to change notification settings - Fork 0
/
vkj.TimeConverter.min.js
1 lines (1 loc) · 1.04 KB
/
vkj.TimeConverter.min.js
1
function GetDuration(t,o,e,l){var h=0,n=0,i=0,r=0,d=0;return"short"===o&&"hourmin"===e?(h=t,h-=86400*(n=Math.floor(h/86400)),r=(h-=3600*(i=Math.floor(h/3600)))/60,d=((""+i).length<2?"0":"")+i.toFixed(2)+l+((""+r).length<2?"0":"")+r.toFixed(2)+l+((""+h).length<2?"0":"")+h.toFixed(2)):"short"===o&&"houronly"===e?(h=t,h-=86400*(n=Math.floor(h/86400)),d=((""+(i=24*n)).length<2?"0":"")+i.toFixed(2)):"short"===o&&"minonly"===e?(h=t,d=((""+(r=60*(i=24*(n=Math.floor(h/86400))))).length<2?"0":"")+r.toFixed(2)):"long"===o&&"all"===e?(h=t,h-=86400*(n=Math.floor(h/86400)),r=(h-=3600*(i=Math.floor(h/3600)))/60,d=((""+n).length<2?"0":"")+n.toFixed(2)+" Days "+((""+i).length<2?"0":"")+i.toFixed(2)+" Hours "+((""+r).length<2?"0":"")+r.toFixed(2)+" Minutes "+((""+h).length<2?"0":"")+h.toFixed(2)+" Seconds "):"semi"===o&&"all"===e&&(h=t,h-=86400*(n=Math.floor(h/86400)),r=(h-=3600*(i=Math.floor(h/3600)))/60,d=((""+n).length<2?"0":"")+n.toFixed(2)+l+((""+i).length<2?"0":"")+i.toFixed(2)+l+((""+r).length<2?"0":"")+r.toFixed(2)+l+((""+h).length<2?"0":"")+h.toFixed(2)),d}