-
Notifications
You must be signed in to change notification settings - Fork 215
toLocaleString not respecting short format (numeric, numeric, numeric) #64
Comments
Works for me in Chrome 34 and Firefox 28. What browser are you using? Are you using the NPM/Bower release or the latest commits from the master branch? Note that recent commits changed the way Intl.js implements |
Closing as invalid due to no further information. |
Sorry for the late reply. Try this in node. Let me know if you need more information. The expected value is all numeric, so: 31/12/1969. node --version = v0.10.21. but I've also experienced it in an older version of Firefox
|
If you want to localize for |
Hmm... I changed the last line to use |
That's right. Sorry for the typo. Even with en-GB, it is still incorrect. Should this issue be re-opened or should I file a new issue? |
Hmm... it looks like it's something to do with finding the closest matching pattern. Obviously it shouldn't be finding the pattern with
I'm using a newer compilation of the data with improved patterns that I'll be pushing shortly for #65 (so your results might vary). I'll take a look at the pattern matching algorithm while I'm at it. |
OK, I've had a look at the pattern matching algorithm. The specification defines 2 algorithms: "basic" and "best fit". "basic" is fully mapped out by the spec, whereas "best fit" should be implementation dependant. In the interests of focusing on more important stuff, I set It turns out that it's not really good enough. For this particular issue, the TL;DR |
(new Date(1)).toLocaleString('en-US', { year: 'numeric', month : 'numeric', day : 'numeric' });
"31 Dec 1969" instead of "12/31/1969"
The text was updated successfully, but these errors were encountered: