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

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Snoupix
Copy link

@Snoupix Snoupix commented Feb 22, 2024

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).

When switching months view, if Day is greater than min month day - 1, it wouldn't work
Needs to be finished tho
Copy link

vercel bot commented Feb 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stwui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 1:53pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant