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
[date-picker] Allow 2-digit years (i.e. dates before year 100) #1600
Comments
I read this CookBook recipe: instead of initializing the JavaScript Date() object as a (year, month, day) triple in i18n.formatDate(), shouldn't it use an ISO-8601-formatted date string? Thanks, |
If the issue is about how the Enhanced Date Picker parses the date string, and not about vaadin-date-picker specifically, please report the issue in https://github.com/vaadin-component-factory/enhanced-date-picker |
No, it's also for DatePicker: try https://vaadin.com/components/vaadin-date-picker/java-examples, pick the first example and enter 3/17/0084 (US locale), it will become 3/17/1984. EnhancedDatePicker just inherits this issue. Thanks, |
@web-padawan (I think the "waiting for author" tag is wrong here...) Thanks, |
Sorry about the lack of response since the last comment. https://vaadin.com/docs/latest/ds/components/date-picker/#date-format Closing as fixed. |
Description
When (Enhanced)DatePicker is set to use "dd/MM/yyyy" as pattern and "dd/MM/yyyy", "dd/MM/yy" as parsers, inputting a year before 100 will result in a wrong date being reformatted.
i.e.: 13/01/0040 or 13/01/40 (13th January 40, not 1940 or 2040)
-> result: 1940-01-13
Expected outcome
The string should be parsed properly as 0040-01-13.
At this point, this component is unable to handle dates before year 100.
Thanks,
MZ
The text was updated successfully, but these errors were encountered: