I have a datepicker field that the maxDate doesn't seem to be working on.


$(document).ready(function() {
    $("#intorgDate").change(function() {
        var myDate = new Date($("#intorgDate").val()); //ENTER VALUE IN mm/dd/yy FORMAT
        var mymaxDate = new Date(myDate +7);
            inline: true,
            dateFormat: "mm/dd/yy",
            changeFirstDay: false,                  
            minDate: myDate,
            maxDate: mymaxDate


org date:<br>
<input type="text" id="intorgDate" /><br>
new date:<br>
<input type="text" id="intnewDate" /><br>​

I have also tried setting maxDate to: maxDate: myDate 7, maxDate: myDate +7, and myDate "+7" - All with no luck.

You can see it in action here: http://jsfiddle.net/eQRqt/30/

What am I missing?

Finally got this working with:

//Destroy Previous Datepicker
//Create New Datepicker
var orgDate = $.datepicker.parseDate('mm/dd/yy', $('#intoriginalDate').val());
var maxDate = $.datepicker.parseDate('mm/dd/yy', $('#intoriginalDate').val());
var maxDays = parseInt(23);
maxDate.setDate(maxDate.getDate() + maxDays);
    inline: true,
    beforeShowDay: noWeekendsOrHolidays,
    dateFormat: "mm/dd/yy",                  
    minDate: orgDate,
    maxDate: maxDate

Hopefully someone can find this usefull.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.