Files
new-api-analytics/lib/time-range-context.tsx
shangzy 13805a47be fix: refactor time range to single source of truth with correct dates
- Default range changed from 30d to 7d
- Presets (today/7d/30d) now directly set customStart/customEnd dates,
  eliminating duplicate getTimeRange() calculation
- "All" preset fetches actual data boundaries from /api/date-range
  and backfills the custom date picker
- Clicking "custom" opens popover without triggering data refresh;
  only confirm applies changes
- SQL trend dates cast to ::text to avoid pg driver Date timezone offset
- Fix created_at filter from < to <= for end timestamp
2026-04-07 16:22:18 +08:00

5.2 KiB