a
This commit is contained in:
parent
3a07c55281
commit
c7444d884c
|
|
@ -104,10 +104,10 @@ function RecommendationsViewer() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatTime = (timeStr) => {
|
const formatTime = (timeStr) => {
|
||||||
if (!timeStr) return '-'
|
if (!timeStr) return '-';
|
||||||
try {
|
try {
|
||||||
const date = new Date(timeStr)
|
const date = new Date(timeStr);
|
||||||
if (isNaN(date.getTime())) return timeStr
|
if (isNaN(date.getTime())) return timeStr;
|
||||||
// 使用北京时间格式化
|
// 使用北京时间格式化
|
||||||
return date.toLocaleString('zh-CN', {
|
return date.toLocaleString('zh-CN', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
|
|
@ -117,22 +117,6 @@ function RecommendationsViewer() {
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
second: '2-digit',
|
second: '2-digit',
|
||||||
timeZone: 'Asia/Shanghai' // 明确使用北京时间
|
timeZone: 'Asia/Shanghai' // 明确使用北京时间
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
return timeStr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!timeStr) return '-';
|
|
||||||
try {
|
|
||||||
const date = new Date(timeStr);
|
|
||||||
return date.toLocaleString('zh-CN', {
|
|
||||||
year: 'numeric',
|
|
||||||
month: '2-digit',
|
|
||||||
day: '2-digit',
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit',
|
|
||||||
second: '2-digit',
|
|
||||||
timeZone: 'Asia/Shanghai'
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return timeStr;
|
return timeStr;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user