Localization & jQuery datePicker

I've started using jsFiddle.net to quickly try out jQuery scripts, I've also found an online Bootstrap distribution so I can make it look pretty too.

This time I wanted to make the datePicker jQuery UI feature use the browsers language setting to display dates in the correct format. It turns out that jQuery already handles this and more, in fact it translates all the text too.

You'll have to change your browser's language settings to test it properly, but it you wanted to quickly test it with a different language you can edit the fiddle and replace the first line of javascript with this:

language = 'de-DE';

Here's the fiddle:

0 comments: