修正北京时间并更换新闻候选源
This commit is contained in:
+4
-1
@@ -454,9 +454,12 @@ HOME_PAGE_HTML = """
|
||||
|
||||
function formatDate(value) {
|
||||
if (!value) return "未标注时间";
|
||||
const date = new Date(value);
|
||||
const text = String(value);
|
||||
const normalized = /(?:Z|[+-]\\d{2}:\\d{2})$/.test(text) ? text : `${text}+08:00`;
|
||||
const date = new Date(normalized);
|
||||
if (Number.isNaN(date.getTime())) return "未标注时间";
|
||||
return date.toLocaleString("zh-CN", {
|
||||
timeZone: "Asia/Shanghai",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
|
||||
Reference in New Issue
Block a user