View Full Version : jQuery UI Datepicker Default date of second calendar depending on first

Feb 18th, 2012, 03:05 AM
I have 2 calendars using jquery UI datepicker. The first calendar is default to todays date. What I need to happen is for the second calendar default date to change to default date (of first calendar) + 1 day. I'm really not too sure how to do this... So any help would be great!

This is the code I have so far:


dateFormat: "dd/mm/yy" }).val()
$('#startDate').datepicker('setDate', new Date());


dateFormat: "dd/mm/yy" }).val()


$('#startDate').datepicker({onSelect: function(dateStr) {
$('#endDate').datepicker('option', 'defaultDate', dateStr);