views:

292

answers:

1

i basically copied the code from here but when i tested my site i saw this:

alt text

any idea why i am not getting an english calendar

+1  A: 

From the jQuery UI docs, it's based on your computer's locale as c0mrade said in comments, but you can override:

Localization

Datepicker provides support for localizing its content to cater for different languages and date formats. Each localization is contained within its own file with the language code appended to the name, e.g. jquery.ui.datepicker-fr.js for French. These files are loaded after the main datepicker code. They add their settings to the set of available localizations and automatically apply them as defaults for all instances.

The $.datepicker.regional attribute holds an array of localizations, indexed by language code, with '' referring to the default (English). Each entry is an object with the following attributes: closeText, prevText, nextText, currentText, monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, weekHeader, dateFormat, firstDay, isRTL, showMonthAfterYear, and yearSuffix.

You can restore the default localizations with:

$.datepicker.setDefaults($.datepicker.regional['']);

And can then override an individual datepicker for a specific locale:

$(selector).datepicker($.datepicker.regional['fr']);
Nick Craver
@Nick Craver: i already have this line:`$('#datepicker').datepicker({ dateFormat: 'dd-M-yy' });`how would i combine the two ?
ooo
@oo - Just call `$.datepicker.setDefaults($.datepicker.regional['']);` before it, setting the region for all your date pickers...you can place any of the 2 character strings are the param at the end, look at the source of this, dropdown at the end to get a list of options: view-source:http://jqueryui.com/demos/datepicker/localization.html
Nick Craver