fix: 全站时间统一为北京时间(Asia/Shanghai)
新增 src/utils/datetime.ts 共享 formatBjTime 工具, 13 个页面(11后台+2前台) 的 toLocaleString/formatDate 改为显式北京时间。Dashboard.tsx 保留图表标签的 formatDate(split) 不受影响。
This commit is contained in:
1 parent
82afe14a23
commit
b3866f770c
12 files changed
+34
-19
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { adminAPI } from '@/api';
|
||||
import { formatBjTime } from '@/utils/datetime';
|
||||
|
||||
interface AutomationTask {
|
||||
id: string;
|
||||
@@ -270,7 +271,7 @@ const Automation: React.FC = () => {
|
||||
// Format time
|
||||
const formatTime = (ts: string) => {
|
||||
if (!ts) return '-';
|
||||
try { return new Date(ts).toLocaleString('zh-CN'); }
|
||||
try { return formatBjTime(ts); }
|
||||
catch { return ts; }
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user