My Technical Notes

Friday, 15 March 2013

Setting Defaults on JQuery DatePicker

The following defaults are what I put on jQuery's DatePicker. The dateFormat is set to that of UK, and I like the option of being able to change the month and year from a drop down list instead of forcing the user to click through to the right month and year.

(function setDatePickerDefaults() {
    $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true });

No comments: