feat: global time range context with custom date picker

Lift time range state into a shared React context so the selected
range persists across page navigation and browser refreshes
(localStorage). Add a "Custom" option with a popover date picker
that lets users specify arbitrary start/end dates. All preset end
times now use endOf("day") (23:59:59) instead of the current moment.
This commit is contained in:
2026-04-07 14:49:58 +08:00
parent 004fd37622
commit 9bb36432ba
10 changed files with 280 additions and 55 deletions

View File

@@ -26,6 +26,10 @@ const translations = {
"time.7d": "7 天",
"time.30d": "30 天",
"time.all": "全部",
"time.custom": "自定义",
"time.startDate": "开始日期",
"time.endDate": "结束日期",
"time.confirm": "确认",
// granularity
"gran.day": "日",
"gran.week": "周",
@@ -108,6 +112,10 @@ const translations = {
"time.7d": "7 Days",
"time.30d": "30 Days",
"time.all": "All",
"time.custom": "Custom",
"time.startDate": "Start",
"time.endDate": "End",
"time.confirm": "Confirm",
"gran.day": "Day",
"gran.week": "Week",
"gran.month": "Month",