Skip to content

fix: Allow all times to be selected in the Start Time filter when consecutive dates are picked#1196

Merged
adhityamamallan merged 5 commits intocadence-workflow:masterfrom
adhityamamallan:fix-date-filter-bug
Feb 26, 2026
Merged

fix: Allow all times to be selected in the Start Time filter when consecutive dates are picked#1196
adhityamamallan merged 5 commits intocadence-workflow:masterfrom
adhityamamallan:fix-date-filter-bug

Conversation

@adhityamamallan
Copy link
Member

@adhityamamallan adhityamamallan commented Feb 25, 2026

Summary

Problem

The date filter shows only 12:00 AM as a selectable option in the Start Time picker when consecutive dates are selected. This is because of a bug in the Baseweb TimePicker when maxTime is exactly 1 day after minTime.

  • The initial value of the TimePicker is set to the same value as minTime.
  • The TimePicker's internal dayEnd variable (midnight of the day after startTime's day) is set to the start of the next day
  • The TimePicker then checks if the maxTime we pass is strictly after dayEnd
  • Since this check fails for consecutive dates (dayEnd = maxTime), it sets the TimePicker's max possible value to midnight of startTime's day, allowing for only one possible value - 12:00 AM.
  • Code link: https://github.com/uber/baseweb/blob/main/src/timepicker/timepicker.tsx#L217

Solution

Only pass the minTime and maxTime values if both fall on the same day.

Test plan

Added unit tests to ensure the props are passed correctly + ran locally.

Before

Screen.Recording.2026-02-25.at.17.44.01.mov

After

Screen.Recording.2026-02-25.at.17.42.08.mov

Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
@adhityamamallan adhityamamallan merged commit c3806f9 into cadence-workflow:master Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants