Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unmeaningful assertion error for focusedDay.isAfter(firstDay) #822

Open
Xazin opened this issue Sep 9, 2023 · 0 comments
Open

[Bug] Unmeaningful assertion error for focusedDay.isAfter(firstDay) #822

Xazin opened this issue Sep 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Xazin
Copy link

Xazin commented Sep 9, 2023

Describe the bug
Since it's an assertion error, it's not super harmful, but in our application for example, it's possible to store a date, but not select a date that is before today. That means there is a possibility, for the calendar picker to be opened, where firstDay is today, and focusedDay is sometime in the past.

I'm not sure why this assertion is important, as the focused day shouldn't affect the logic of the selection of dates.

Can we remove these kind of assertions?

assert(isSameDay(focusedDay, firstDay) || focusedDay.isAfter(firstDay)),
assert(isSameDay(focusedDay, lastDay) || focusedDay.isBefore(lastDay)),

Expected behavior
The focused day is independant of the date selection behavior, as it could have occurred in the past, and the new date selection criteria does not depend on the focused date.

@Xazin Xazin added the bug Something isn't working label Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant