Join 3,512 readers in helping fund MetaFilter (Hide)


JavaScript question
October 4, 2012 9:35 AM   Subscribe

JavaScript question: Here in the U.S. myDate.toLocaleDateString () returns Thursday, Oct. 04, 2012. Can anyone give me an example of the date formatted for another locale?
posted by markcmyers to Technology (2 answers total) 1 user marked this as a favorite
 
My locale should be Swedish and I get the following output: Thursday, October 04, 2012

Mozilla's docs explains that you can't really trust toLocaleDateString().
posted by Foci for Analysis at 9:58 AM on October 4, 2012 [1 favorite]


I will copy/paste this from my own code:


// Safari does this correctly.
if (SAFARI) {
return date.toLocaleDateString();
}

// Chrome, however (at least on OS X) seems to think that it's always in the US,
// so we try and do something reasonable.

// A bunch of other code to try and build my own date strings goes here...

posted by tylerkaraszewski at 10:19 AM on October 4, 2012


« Older I'm moving to Boston for a new...   |  What additional steps should I... Newer »
This thread is closed to new comments.