Conversation
…ata, added yesterday and today presets for date range, fixed presets start and end date
Evidence input default value
…s date is not available
|
@arefabouhamdan it looks like the only check failing is the formatting/lint check. If you run |
|
@arefabouhamdan for the timezone and off-by-one issues, can you share how you were seeing that show up? We've typically only seen it with users east of UTC line, so just want to make sure you had a good starting test that was failing and can confirm it works now both in that case, and in the west of UTC case |
|
@arefabouhamdan do you know why the default dates of the date input have changed? Below are current live docs and the preview docs from this PR: Current Docs
This PR
|
|
@hughess We wanted the DateInput and DateRange components default to today's date (or the nearest available date in the data range) when no explicit defaultValue is provided. This ensures the component always shows the latest available data on initial load, rather than leaving the selection empty. If today falls outside the data range, it intelligently falls back to the closest boundary date (the end or start of the dataset), so the user always sees the most recent relevant data. |
|
@hughess and regarding the timezone issue it was always off by 1 day in my timezone (EET), after the changes we tested it on multiple timezones and it was accurate on all of them |


Description
This PR addresses several issues with the date input component, including timezone handling, default values, year selection, date range presets, and improved date boundary management.
Changes Summary
🐛 Bug Fixes
1. Timezone Fix
toISOString()which could cause timezone-related date shiftsdateToYYYYMMDD()inhelpers.jsto use local date components instead of ISO string conversion2. Default Value Fix
today(getLocalTimeZone())as the reference date3. Extra Day End String Fix
extraDayEndStringwas only calculated for range inputs, causing issues with single date inputsrangecondition check soextraDayEndStringis calculated for all inputs✨ New Features
4. Data-Driven Year Selection & Date Disabling
dataanddatesprops to extract available years from query datacalendarStartandcalendarEnd(withextraDayEndStringfor safety) to setminValueandmaxValue, which automatically disables dates outside the range5. New Date Range Presets
6. Improved Preset Calculations
referenceDatethat selects the appropriate reference pointtodayDateinstead ofcalendarEnd7. Enhanced Year Selection Logic
Checklist