fix: time format in balance history

This commit is contained in:
Rogee
2024-12-16 23:34:51 +08:00
parent 2c972d263c
commit 16f4b68e53

View File

@@ -46,12 +46,9 @@ export default defineComponent({
const minute = date.getUTCMinutes();
const second = date.getUTCSeconds();
// 按照要求格式输出
let formattedTime = `${year}/${month}/${day}`;
// 如果是同一年份则不显示年份
if (new Date().getUTCFullYear() === year) {
formattedTime = `${month}/${day} ${hour}:${minute}`;
}
// 格式化时间为 2021/1/1 12:00:00
const formattedTime = `${year}/${month}/${day} ${hour}:${minute}:${second}`;
return formattedTime;
}