fix: time format in balance history

This commit is contained in:
Rogee
2024-12-16 23:22:38 +08:00
parent d7257f9808
commit d4cc04d254

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;
}