修正北京时间并更换新闻候选源

This commit is contained in:
Codex
2026-07-08 23:08:55 +08:00
parent 3ece2327c8
commit 88e1cf4b7a
10 changed files with 178 additions and 55 deletions
+4 -1
View File
@@ -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",