-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Calendar reports invalid date format when using ca_ES locale #24533
Comments
Thanks, I see it with both 3.2 and master, will debug/fix a.s.a.p. |
OK, I have a fix but I think I need to improve/generalize it before making the PR. The problem is that cs_ES, as well as cs_CZ and a bunch of Indian and Nepal locales use Please let me know if anybody has any comments about this. |
That sounds like a good plan. Thanks! |
Some locales use format specifiers not supported (yet) by wxDateTime::Parse() and while the best fix is to add support for them, as it has been already done for %F (see wxWidgets#24173) and will be done for "%-" (see wxWidgets#24533) soon, it still seems wise to handle the locales for which it still might happen, now or in the future, more gracefully by falling back to ISO 8601 date format if the locale format can't be used because we can't parse it. Note that an alternative approach could consist in using the locale format for formatting the dates and falling back to ISO 8601 only for parsing them, but it would arguably be confusing to the user if the program expected input in a format different from what it uses for displaying the dates, so prefer just using the same format for both, if we can't do otherwise.
The PR above fixes parsing dates in So parsing dates in the following locales, available on my Debian system, still doesn't work correctly:
But with ISO 8601 it's a bit less catastrophic as before. |
Some locales use format specifiers not supported (yet) by wxDateTime::Parse() and while the best fix is to add support for them, as it has been already done for %F (see wxWidgets#24173) and will be done for "%-" (see wxWidgets#24533) soon, it still seems wise to handle the locales for which it still might happen, now or in the future, more gracefully by falling back to ISO 8601 date format if the locale format can't be used because we can't parse it. Note that an alternative approach could consist in using the locale format for formatting the dates and falling back to ISO 8601 only for parsing them, but it would arguably be confusing to the user if the program expected input in a format different from what it uses for displaying the dates, so prefer just using the same format for both, if we can't do otherwise. (cherry picked from commit 8e66698)
This is not really used when parsing, but we still need to support the GNU extensions to the strftime() formatting specifiers used to change padding, as they can (and do, at least in the case of "%-d" and "%-m") occur in the locale descriptions and so can be used when parsing dates using the current locale format. See wxWidgets#24533. (cherry picked from commit 2cc3a38)
Description
Bug description:
Wx does not appear to recognize dates for Linux systems when running in Catalan locale (ca_ES.UTF-8)
Expected vs observed behaviour:
Selecting a calendar date in the wx calendar sample fails verification. Note that this is not only when typing the date in but also when selecting the calendar date using the widget.
To Reproduce:
Steps to reproduce the behaviour, please make them as detailed as possible.
For example:
Platform and version information
See also https://gitlab.com/kicad/code/kicad/-/issues/17992 . Apparently affects Czech language as well but not French
The text was updated successfully, but these errors were encountered: