Issue(datepicker): When setting a min/max date, cannot switch back or switch forward a month when day is lower than min or higher than max #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I've spotted an issue when you set a min Date (let's say for example: 2 feb 2024) and you are looking this date.month + 1 and select, for example, date.day - 1 (so 1 mar 2024), you can't go back because it would check if, for example, 1 feb is less than min date so it's not switching back until we set the day to be in range of date.day..end of month.
To me, it's an issue because it's not even setting the date when we switch to month - 1 (for example), so no bother checking the (min/max) day, set it to the min (or max) and let the client switch back a month. It would be more use-friendly IMHO.
I ran the
format
command for the prettier, added an example on the/datepicker
route with a min date and I started the "fix" on the date-picker component itself, it's not working as excepted when setting a max date only but it is when setting a min date only (the visuals on the lowest date works only for the previous month, not days tho, so it's kind of a new bug related to the fix).