Reputation: 1628
We have a system where we instantiate many .datepicker objects
I know I can set the start date like so
$('.selector').datepicker('option', 'firstDay', 4); // i.e. Thursday
Is there a way of setting this value by default, for all subsequent .datepicker requests (without the need to have to specify the firstDay option at the point of execution?
Upvotes: 0
Views: 266
Reputation: 3922
There is lots of options available with Jquery UI datepicker
$.datepicker.setDefaults({
constrainInput: true, // prevent letters in the input field
minDate: new Date(), // prevent selection of date older than today
showOn: 'button', // Show a button next to the text-field
autoSize: true, // automatically resize the input field
altFormat: 'yy-mm-dd', // Date Format used
firstDay: 4 // Start with Thursday
})
Upvotes: 3