mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 修复pretest结果不回显的问题
This commit is contained in:
1 parent
25570d6275
commit
cce3b3a745
6 files changed
+69
-39
No files matched your search
@@ -232,15 +232,10 @@ export namespace Time {
|
||||
export const week = day * 7;
|
||||
export function formatTimeShort(ms: number) {
|
||||
const abs = Math.abs(ms);
|
||||
if (abs >= day - hour / 2) {
|
||||
return `${Math.round(ms / day)}d`;
|
||||
} if (abs >= hour - minute / 2) {
|
||||
return `${Math.round(ms / hour)}h`;
|
||||
} if (abs >= minute - second / 2) {
|
||||
return `${Math.round(ms / minute)}m`;
|
||||
} if (abs >= second) {
|
||||
return `${Math.round(ms / second)}s`;
|
||||
}
|
||||
if (abs >= day - hour / 2) return `${Math.round(ms / day)}d`;
|
||||
if (abs >= hour - minute / 2) return `${Math.round(ms / hour)}h`;
|
||||
if (abs >= minute - second / 2) return `${Math.round(ms / minute)}m`;
|
||||
if (abs >= second) return `${Math.round(ms / second)}s`;
|
||||
return `${ms}ms`;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user