feat(web): simplify ranking time range labels

This commit is contained in:
kairee committed 2026-11-03 03:11:20 +08:00
1 parent 11930db2bf
commit 99b71c037c
4 files changed
+9 -9

No files matched your search

+6 -6
View File
@@ -29,11 +29,11 @@ const UP_SORTS = [
["latest", "最近发布"],
];
const TIME_RANGES = [
["all", "全部时间"],
["7", "近 7 天"],
["30", "近 30 天"],
["90", "近 90 天"],
["365", "近 1 年"],
["all", "全部"],
["7", "7天内"],
["30", "30天内"],
["90", "90天内"],
["365", "1年内"],
];
const VIDEO_METRIC_PRIMARY = new Set(["view", "coin", "favorite", "reply"]);
const OVERVIEW_TTL = 60_000;
@@ -63,7 +63,7 @@ function timeOptions(within, year, years) {
const base = TIME_RANGES.map(([value, label]) =>
`<option value="${value}" ${selected === value ? "selected" : ""}>${escapeHtml(label)}</option>`).join("");
const yearOptions = (years || []).map((value) =>
`<option value="year:${value}" ${selected === `year:${value}` ? "selected" : ""}>${value} 年</option>`).join("");
`<option value="year:${value}" ${selected === `year:${value}` ? "selected" : ""}>${value}年</option>`).join("");
return base + yearOptions;
}