You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the Issues to see if this bug has already been reported
I have tested the latest version
Steps to reproduce
Go to the Datepicker component and set minDate={new Date()} as the current date. The maxDate can be any date in the following month.
If your minDate is set to any day other than the first of the month, when you switch to the month view, the month containing your minDate will be disabled.
The issue seems to stem from the isDateInRange() function, which considers newDate as the first day of the month. This function should be split into two: one for days and another for months, years, and decades. While the current function works fine for day selection, it should be slightly modified for months, years, and decades to allow navigation and selection even if minDate or maxDate falls within the same month.
Current behavior
When minDate is set to any day other than the first of the month, the month button is disabled when navigating back to that month.
Expected behavior
The header button should allow navigation to the month containing the minDate.
Context
The desired functionality is to enable navigation to the month where minDate is set, even if it isn't the first of the month. Additionally, if both minDate and maxDate are within the same month, the button should still allow navigation to that month. Currently, when using the change view button, the month becomes disabled, and the user is forced to shift to the next month if maxDate is in the future.
Here is a short video of me on Flowbite Storybook's Datepicker story, showing the issue when trying to click the button with no response:
Steps to reproduce
The issue seems to stem from the isDateInRange() function, which considers newDate as the first day of the month. This function should be split into two: one for days and another for months, years, and decades. While the current function works fine for day selection, it should be slightly modified for months, years, and decades to allow navigation and selection even if minDate or maxDate falls within the same month.
Current behavior
When minDate is set to any day other than the first of the month, the month button is disabled when navigating back to that month.
Expected behavior
The header button should allow navigation to the month containing the minDate.
Context
The desired functionality is to enable navigation to the month where minDate is set, even if it isn't the first of the month. Additionally, if both minDate and maxDate are within the same month, the button should still allow navigation to that month. Currently, when using the change view button, the month becomes disabled, and the user is forced to shift to the next month if maxDate is in the future.
Here is a short video of me on Flowbite Storybook's Datepicker story, showing the issue when trying to click the button with no response:
Components._.Datepicker.-.Default.Storybook.-.Google.Chrome.2024-09-27.16-49-26.mp4
The text was updated successfully, but these errors were encountered: