adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
13.03k stars 1.13k forks source link

The date field is not working correctly #7337

Closed pan-alexey closed 1 day ago

pan-alexey commented 5 days ago

Provide a general summary of the issue here

When using the calendar, the year 0001 can be used. Due to this issue, when entering February 29, 2024, the calendar resets the value to February 28, 0001.

https://github.com/user-attachments/assets/71886ae5-e55f-4658-a6ff-d4819f6a454d

๐Ÿค” Expected Behavior?

When using the calendar, the year 1 AD can be used. Due to this issue, when entering February 29, 2024, the calendar resets the value to February 28, 0001.

๐Ÿ˜ฏ Current Behavior

When using the calendar, the year 1 AD can be used. Due to this issue, when entering February 29, 2024, the calendar resets the value to February 28, 0001.

๐Ÿ’ Possible Solution

Enable validation of the field only after the complete entry of the year. Currently, the validation for the date is in the "number" format, not "4 digits."

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

Open DatePicker and try entering February 29, 2024

https://react-spectrum.adobe.com/react-aria/useDatePicker.html

Version

3.35.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Mac OS

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

pan-alexey commented 2 days ago

Any ideas?

yihuiliao commented 1 day ago

I think this is a dupe of https://github.com/adobe/react-spectrum/issues/5965

snowystinger commented 1 day ago

closing as duplicate. I'm not seeing the jump from 2024 -> 0001, just the change from 29->28 for the day field. Could be a different issue specific to a certain setup for the year issue, we can reopen if that can be reproduced.