Details page.

This commit is contained in:
Mike Cao 2020-07-31 19:05:14 -07:00
parent 5b45301178
commit ac2612924e
12 changed files with 312 additions and 10 deletions

View file

@ -24,10 +24,6 @@ export function formatTime(val) {
}
export function formatShortTime(val, formats = ['m', 's'], space = '') {
if (val <= 0) {
return `0${formats[formats.length - 1]}`;
}
const { days, hours, minutes, seconds, ms } = parseTime(val);
let t = '';
@ -37,5 +33,9 @@ export function formatShortTime(val, formats = ['m', 's'], space = '') {
if (seconds > 0 && formats.indexOf('s') !== -1) t += `${seconds}s${space}`;
if (ms > 0 && formats.indexOf('ms') !== -1) t += `${ms}ms`;
if (!t) {
return `0${formats[formats.length - 1]}`;
}
return t;
}