Repository navigation
fix(dashboard): send chart ranges with one UTC offset across DST - #989
Conversation
- Fix 400 "Start and end dates must have the same timezone" on All time and DST-crossing ranges - Keep the first day bucket complete and cover whole picked days in custom ranges
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughChart date range utilities now format start timestamps using the end timestamp’s UTC offset. Day and month query ranges use day boundaries, and input date ranges are normalized before query range construction. ChangesChart date range formatting
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Chart ranges now use a consistent offset across DST, and the inspected API handling is compatible with those bounds. No new merge-blocking behavior is established. Pre-merge checks |
|
…ain bba95f274 Checked with git ls-remote on 2026-10-11 02:55 UTC. Panel dev moved from d94e157 to 83fe90e with 22 commits; main is still v5.4.1. - PasarGuard#879 (2d0ca81, loopback Xray client inbounds) is ported by design: the fork took the open pull request on 2026-09-25 as 2e7fc45 with migration bfd88026565b, the same listener rewrite. - PasarGuard#934 (a5b28f3) moves from the port queue to a dated waiver until 2026-11-09: the fork refuses to delete a core that nodes still use (W3-013, fix/node-health) instead of restarting those nodes. - PasarGuard#993 (Hysteria2 FinalMask without a udp mask) is queued until 2026-10-18: the fork has the same FinalMask | dict field and the same non-null-safe udpHop reads, so a udpHop-only host can fail the whole subscription. - PasarGuard#984, PasarGuard#985, PasarGuard#986, PasarGuard#989, PasarGuard#944, PasarGuard#864, PasarGuard#948, PasarGuard#951, PasarGuard#778, PasarGuard#774, PasarGuard#787, PasarGuard#994, PasarGuard#865, PasarGuard#875, PasarGuard#718, PasarGuard#967, PasarGuard#772, PasarGuard#662, PasarGuard#995 and PasarGuard#913 are queued as security: no until 2026-10-25, each with its reason; PasarGuard#913's node-removal half is already in the fork through sync_remove_users. - The branch commits that upstream squash-merged (the three dashboard branches, telegram/tests, fix/core-editor-api-section-followup, fix/hwid-count-test-cleanup, fix/hysteria-finalmask-quic-only) follow their squash, by patch-id or by an equal tree. Scripts main moved to bba95f274 (PasarGuard#35, PasarGuard#36, PasarGuard#37 after PasarGuard#34). The three squashes are queued security: no until 2026-10-25, and their pre-squash branch commits are waived as superseded (equal trees). Against live upstream the panel gate now fails only on the 17 port-queue commits classified security: yes, and the forks gate only on node f72ac0ef (security: yes). No upstream commit is undecided.
…arGuard#989) - Fix 400 "Start and end dates must have the same timezone" on All time and DST-crossing ranges - Keep the first day bucket complete and cover whole picked days in custom ranges (cherry picked from commit 795dc70)
Summary
validate_datesrejects a range whose start and end have different UTC offsets ("Start and end dates must have the same timezone", 400). The dashboard formats each bound in its own local offset, so in time zones with DST every statistics chart fails for "All time" whenever today's offset differs from the one on 2000-01-01 (summer time in Europe, winter in Sydney), and for ranges that cross a DST change (for example "1m" in late October in Europe, or "1w" in Sydney during the first week of October).Chart query ranges are now sent with one offset, the end's:
2000-01-01T00:00:00+02:00), so the first day bucket stays complete;get_complete_period_start_for_filterwould otherwise round a shifted start up to the next day. This also covers days without a local midnight (America/Santiago, America/Havana, Asia/Beirut), wherestartOf('day')is 01:00 and the first day was dropped before as well.utcOffset(n)shifts by local time and lands an hour late across the spring change).getDateRangeForPeriodOption(node stats area chart) uses the same rule.Shortcuts and period options that do not cross a DST change produce the same strings as before.
Type of change
Checklist
Testing
chart-period-utils.tsand thedevcopy withTZ= Europe/Berlin (Mar 29, Apr 10, Oct 9, Nov 5), Australia/Sydney, America/New_York (Mar 8), America/Santiago, America/Havana, Asia/Beirut, Asia/Tehran, Asia/Kathmandu, UTC; shortcuts 1h/24h/1w/1m/all, custom ranges, period optionsdeveslint --quieton touched files,vite buildScreenshots
Not applicable.
Notes for reviewers
formatOffsetStartOfDayhad no callers left and is removed.Summary by CodeRabbit