refactor: 优化时间格式化函数
This commit is contained in:
parent
c6ab72cd5b
commit
e1b02e0458
@ -99,7 +99,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ocr-config">
|
<div class="ocr-config">
|
||||||
<a-form layout="horizontal">
|
<a-form layout="horizontal">
|
||||||
<a-form-item label="使用OCR" name="enable_ocr">
|
<a-form-item label="使用OCR" name="enable_ocr">
|
||||||
@ -641,9 +641,9 @@ const openFileDetail = (record) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatRelativeTime = (timestamp) => {
|
const formatRelativeTime = (timestamp, offset = 0) => {
|
||||||
// 调整为东八区时间(UTC+8)
|
// 如果调整为东八区时间(UTC+8),则offset为8,否则为0
|
||||||
const timezoneOffset = 8 * 60 * 60 * 1000; // 东八区偏移量(毫秒)
|
const timezoneOffset = offset * 60 * 60 * 1000; // 东八区偏移量(毫秒)
|
||||||
const adjustedTimestamp = timestamp + timezoneOffset;
|
const adjustedTimestamp = timestamp + timezoneOffset;
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user