ComposeCalendar icon indicating copy to clipboard operation
ComposeCalendar copied to clipboard

crash when minDate is later in the year than maxDate

Open sproctor opened this issue 2 years ago • 1 comments

If minDate is 2000-05-20 and maxDate is 2023-01-04, the DateRangeIterator will never find a date in 2023, and setting up the year grid state will throw an exception. A simple fix is to use Jan 1 for the start and end days of the dateRangeByYear. We actually want a YearRange there, not a DateRange.

sproctor avatar Jan 04 '23 17:01 sproctor

You can see eca411c360fba0d229c7ea5b2dcdf103605d2bfe with the change from a DateRange to IntRange.

It's possible that stepping by month could have a similar bug if the day of month of the minDate is later than the day of month of the maxDate.

sproctor avatar Jan 04 '23 18:01 sproctor