main ← fix-ai-usage-refresh
opened 10:53PM - 15 Sep 25 UTC
## :mag: Overview
Fixes custom date range functionality in AI usage admin page… where:
- Users experienced visual glitches when selecting dates
- Date picker would show incorrect dates after refresh
- Users had to refresh multiple times to get correct date range
**Changes:**
- Added fromDate/toDate getters with fallback logic for preview functionality
- Updated DateTimeInputRange to use preview-aware getters
- Clear temporary dates after refresh to prevent stale state
- Added system test to prevent regression
The date picker now immediately shows selected dates (preview) and
maintains correct values after refresh, eliminating user confusion.
This addresses the exact issue reported in [the meta topic](https://meta.discourse.org/t/discourse-ai-admin-usage-page-custom-date-range-issues/378959) and provides a clean solution with test coverage to prevent regression.