pageAdmin add setActivePageComputedByRoute function
This commit is contained in:
@@ -111,17 +111,12 @@ export function followTimeLabel(second, max, fixedNumber = 0) {
|
||||
const day = 24 * 60 * 60;
|
||||
const hour = 60 * 60;
|
||||
const minutes = 60;
|
||||
console.log("max / day", max / day);
|
||||
console.log("max % day", max % day);
|
||||
console.log('(max % day) / hour', (max % day) / hour);
|
||||
console.log('max % hour', max % hour);
|
||||
console.log('(max % hour) / minutes', (max % hour) / minutes);
|
||||
|
||||
const dd = Math.floor(max / day);
|
||||
const hh = Math.floor((max % day) / hour);
|
||||
const mm = Math.floor((max % hour) / minutes);
|
||||
let maxUnit = '';
|
||||
let result;
|
||||
console.log("所以dd, hh, mm", dd, hh, mm)
|
||||
maxUnit = dd > 0 ? 'd' : hh > 0 ? 'h' : mm > 0 ? 'm' : 's';
|
||||
switch (maxUnit) {
|
||||
case 'd':
|
||||
@@ -149,7 +144,6 @@ console.log("所以dd, hh, mm", dd, hh, mm)
|
||||
result = second.toFixed(fixedNumber) + 's';
|
||||
break;
|
||||
}
|
||||
console.log("followTimeLabel() result", max, result)
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user