Change manual time formatting to dayjs time fomatting. #39
@ -15,10 +15,13 @@ export const msToTime = (duration: number, long = false) => {
|
|||||||
|
|
||||||
if (long) {
|
if (long) {
|
||||||
let t = '';
|
let t = '';
|
||||||
|
if (time.days()) t+= `${time.days()}d `;
|
||||||
if (time.hours()) t+= `${time.hours()}h `;
|
if (time.hours()) t+= `${time.hours()}h `;
|
||||||
if (time.minutes()) t+= `${time.minutes()}m `;
|
if (time.minutes()) t+= `${time.minutes()}m `;
|
||||||
if (time.seconds()) t+= `${time.seconds()}s`;
|
if (time.seconds()) t+= `${time.seconds()}s`;
|
||||||
|
|
||||||
|
if (!t) t = '1s';
|
||||||
|
|
||||||
return `${time.humanize()} (${t})`;
|
return `${time.humanize()} (${t})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user