I am using jQuery datepicker. In the "EndDate" text box, I would like to use the date selected from the "StartDate" + 1 text box. How do I do this?
I tried this but did not work. In my starter code, I had ...
test = $(this).datepicker('getDate'); testm = new Date(test.getTime()); testm.setDate(testm.getDate() + 1);
Then at my end of the date code I had ...
minDate: testm,
but the end date was still made for the whole month.
Change I am curious why this is not working. In my datepicker start date, I have this ..
onSelect: function (dateText, inst) { test = dateText }
Why can't I go down to datepicker date and say: minDate: test ?
Change Still not working
$(".dateStartDatePickerBox").datepicker({ minDate:'-0d', onSelect: function(dateText, inst) { test = $(this).datepicker('getDate'); testm = new Date(test.getTime()); testm.setDate(testm.getDate() + 1); $("#dateEndDatePickerBox").datepicker("option", "minDate", testm); } }); $(".dateEndDatePickerBox").datepicker({ onSelect: function() { } });
javascript jquery datepicker
d3020
source share