How to set date for an inline Datepicker
in jqueryUI?
You can set multiple dates as well by using this:
allBookings = []
_.each(Session.get('thisGuide').bookings,function(e){
allBookings.push(moment(e).format('MM/DD/YYYY'))
})
$('#datepicker').datepicker('setDates',allBookings)
When initializing a datepicker, you'd use the defaultDate
option:
$("#date").datepicker({
defaultDate: '01/26/2014'
});
FIDDLE
when changing the date later, you'd use setDate
method:
$("#date").datepicker();
// more code
$("#date").datepicker('setDate', '01/26/2014');
FIDDLE