pulibrary / lux-design-system

Princeton University Library's design system
https://pulibrary.github.io/lux-design-system/
1 stars 1 forks source link

LUX DatePicker interprets the months incorrectly when supplied as Props. #299

Open sdellis opened 4 months ago

sdellis commented 4 months ago

Expected behavior

If I use Props to set a default date range or disabled dates, Lux DatePicker will use the correct months, assuming "correct" is the month of January being 01.

Actual behavior

When setting default date range or disabled dates, the DatePicker interprets the months incorrectly as the previous month because it seems to start the months at zero (January == 00). This bug has some side effects as well in the UI.

Screenshot 2024-07-29 at 2 44 04 PM

Steps to replicate

Go to the docs for (Lux DatePicker)[https://pulibrary.github.io/lux-design-system/#/Components?id=luxdatepicker] and try to enter a default date range or disabled date range.

Impact of this bug

Most apps will need to implement logic to fix this, whereas it's best fixed within the DatePicker itself. It may be an upstream bug in the (V-Calendar)[https://vcalendar.io/] code.

Implementation notes, if any

It might be good to audit apps that are currently relying on the Lux DatePicker to make sure they are behaving as expected, or if they have been patched locally, to make sure fixes to the Lux component don't break them in the future.