jQuery datepicker minDate variable

Posted by d3020 on Stack Overflow See other posts from Stack Overflow or by d3020
Published on 2010-03-20T20:23:18Z Indexed on 2010/03/20 20:41 UTC
Read the original article Hit count: 601

Filed under:
|
|

I'm usung the jQuery datepicker. In my "EndDate" textbox I'd like to use the date selected from the the "StartDate" textbox + 1. How do I do this?

I tried this but didn't work. In my start date code I had...

            test = $(this).datepicker('getDate');
            testm = new Date(test.getTime());
            testm.setDate(testm.getDate() + 1);

Then in my end date code I had...

minDate: testm,

but the end date still made all the days for the month available.

Thanks.


Edit. I'm curious as to why this doesn't work. In my start date datepicker I have this.. onSelect: function (dateText, inst) test = dateText

Why can't I come down into my end date datepicker and say, minDate: test?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about datepicker