mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
doc: time text
This commit is contained in:
parent
d04d6f19e3
commit
8ebd2859fc
@ -88,13 +88,13 @@ export function formatRelativeTime(timestamp: number): string {
|
|||||||
|
|
||||||
if (hours > 24) {
|
if (hours > 24) {
|
||||||
const days = Math.floor(hours / 24);
|
const days = Math.floor(hours / 24);
|
||||||
return `${days}天前`;
|
return `${days}d`;
|
||||||
} else if (hours > 0) {
|
} else if (hours > 0) {
|
||||||
return `${hours}小时前`;
|
return `${hours}h`;
|
||||||
} else if (minutes >= 0) {
|
} else if (minutes >= 0) {
|
||||||
return `${minutes}分钟前`;
|
return `${minutes}m`;
|
||||||
} else {
|
} else {
|
||||||
return "刚刚";
|
return "just now";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user