fix: time format in balance history

This commit is contained in:
Rogee
2024-12-16 23:22:38 +08:00
parent d7257f9808
commit d4cc04d254
+5 -1
View File
@@ -47,7 +47,11 @@ export default defineComponent({
const second = date.getUTCSeconds();
// 按照要求格式输出
const formattedTime = `${year}年${month}月${day}日 ${hour}时${minute}分${second}秒`;
let formattedTime = `${year}/${month}/${day} ${hour}:${minute}:${second}`;
// 如果是同一年份则不显示年份
if (new Date().getUTCFullYear() === year) {
formattedTime = `${month}/${day} ${hour}${minute}:${second}`;
}
return formattedTime;
}