N00nDay / stwui

Opinionated yet customizable Svelte-TailwindCSS component library
stwui.vercel.app
MIT License
451 stars 21 forks source link

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

Open Snoupix opened 8 months ago

Snoupix commented 8 months ago

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

vercel[bot] commented 8 months ago

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