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

Error in assertion logic for month picker #14

Closed
Weav3r opened this issue Feb 28, 2024 · 2 comments
Closed

Error in assertion logic for month picker #14

Weav3r opened this issue Feb 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Weav3r
Copy link

Weav3r commented Feb 28, 2024

Description
The assertion for making sure the selected date's month for month_view is not outside of the min and max dates throws exceptions for some dates that are valid because the min and max dates for assertion does not consider the day while the selected date includes the day.

Reproduction Steps:

  1. Use the MonthPicker Widget or showDatePickerDialog (and navigate to the months view)
  2. Set these values as follows:
      minDate: DateTime(2024, 1, 1)
      maxDate: DateTime(2024, 6, 30),
      selectedDate: DateTime(2024, 6, 2) //Any day after 1st June
  1. Activate picker
  2. Exception is thrown

Fix:
Remove/comment out the day when for the selected date

       // selectedDate!.day, 

selectedDate!.day,

@Weav3r
Copy link
Author

Weav3r commented Feb 28, 2024

Also, realized a similar bug affects the year_view as well and I had to comment out the month and day

selectedDate!.month,

@hasanmhallak hasanmhallak self-assigned this Feb 29, 2024
@hasanmhallak hasanmhallak added the bug Something isn't working label Feb 29, 2024
@hasanmhallak
Copy link
Owner

hey @Weav3r thanks for bringing this up, I'll be working on it now and maybe publish a new release.

hasanmhallak added a commit that referenced this issue Feb 29, 2024
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

2 participants