refactor: 优化时间格式化函数

This commit is contained in:
Wenjie Zhang 2025-06-18 21:43:44 +08:00
parent c6ab72cd5b
commit e1b02e0458

View File

@ -99,7 +99,7 @@
</a-button>
</div>
</div>
<div class="ocr-config">
<a-form layout="horizontal">
<a-form-item label="使用OCR" name="enable_ocr">
@ -641,9 +641,9 @@ const openFileDetail = (record) => {
}
}
const formatRelativeTime = (timestamp) => {
// UTC+8
const timezoneOffset = 8 * 60 * 60 * 1000; //
const formatRelativeTime = (timestamp, offset = 0) => {
// UTC+8offset80
const timezoneOffset = offset * 60 * 60 * 1000; //
const adjustedTimestamp = timestamp + timezoneOffset;
const now = Date.now();