Two datepickers. Change second datepicker to the value of the next day value of first day picker
Hi,
I have two date pickers.
On arrival date, one departure date.
When the value of the arrival date picker is changed, I want to change the departure date picker to be the arrival date value + 1 day.
I can't figure it out.
Here is my code.
- $("#arrivaldate").datepicker({
- showOn: 'button',
- buttonImage: 'images/calendar.gif',
- dateFormat: 'dd M yy',
- numberOfMonths: 3,
- minDate: 0,
- onSelect: function(dateText, inst) {
- var newDate = dateText;
- $('#departuredate').datepicker('setDate', newDate);
- },
- constrainInput: true,
- buttonImageOnly: true
- });
-
Can't figure out how to add 1 DAY to the variable newDate.
Any help apreciated.