Skip to content
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 validation with non US locales #153

Closed
Kuvalda opened this issue Jul 22, 2011 · 3 comments
Closed

Date validation with non US locales #153

Kuvalda opened this issue Jul 22, 2011 · 3 comments

Comments

@Kuvalda
Copy link

Kuvalda commented Jul 22, 2011

http://stackoverflow.com/questions/2385474/set-a-locale-in-javascript - i have same problem with all latest browsers Chrome, IE, FF.

there is description and fix (at 2009!):
http://geekswithblogs.net/EltonStoneman/archive/2009/10/29/jquery-date-validation-in-chrome.aspx

Please fix your code :)
10nx!

@CraigStuntz
Copy link

The proposed fix is a bad idea. It relies on undocumented .toLocaleDateString() behavior. Comments on that post claim it doesn't work, which is what I would expect. From the ECMAScript 5 standard:

15.9.5.6 Date.prototype.toLocaleDateString ( )
This function returns a String value. The contents of the String are implementation-dependent, but are
intended to represent the ―date‖ portion of the Date in the current time zone in a convenient, human-readable
form that corresponds to the conventions of the host environment‘s current locale.
NOTE The first parameter to this function is likely to be used in a future version of this standard; it is recommended
that implementations do not use this parameter position for anything else.

I can't find a good fix for this and would be open to ideas. For now, the best solution is to use dateITA in additional-methods.js.

@jzaefferer
Copy link
Collaborator

As for other tickets, Date validation is broken. For now, as suggested above, use locale specific custom methods. Eventually #581 will resolve this.

@akirayamamoto
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants