Calendar 2.1 bug in sensitivity range


I just upgraded my Calendar 1.0 to 2.1, and now my sensitivity range fails.



I have two pop-up calendars cal1 and cal2. When I click cal1, cal2 is hidden, and vice versa.



Since it’s a time interval, cal2 cannot select anything from before the date at cal1, and cal1 cannot select anything past cal2.



I’ve made this little function:



    function selectDate1(date) {

        document.getElementById(‘calInput1’).value = cal1.getFormatedDate(‘%d-%m-%Y’,date);

        document.getElementById(‘calendar1’).style.display = ‘none’;

        dateFrom = new Date(date);

        cal2.setSensitive(dateFrom, ‘31-12-2050’);

        return true;

    }



    function selectDate2(date) {

        document.getElementById(‘calInput2’).value = cal2.getFormatedDate(‘%d-%m-%Y’,date);

        document.getElementById(‘calendar2’).style.display = ‘none’;

        dateTo = new Date(date);

        cal1.setSensitive(‘01-01-1990’, dateTo);

        return true;

    }



When I select cal2, the sensitivity of cal1 is simply gone, it’s all grey’d out.



Again, this works fine with version 1.0, but fails on 2.1.



Any ideas?






Hello,


there was an issue with sensitive range. It was fixed in the latest calendar version. Please, try to use attached file instead of the original one.


dhtmlxcalendar.zip (11.9 KB)


I’ve tried your attached version as well, and it doesn’t work.



With the new version, it’s both grey’d out and I cannot select a date.



I can send you an url to see it in action, if you’d like?



Please, try to use set the range as follows:


cal2.setSensitive(dateFrom, new Date(‘12-31-2050’));





cal1.setSensitive(new Date(‘01-01-1990’), dateTo);


Thank you Alex, that solved the problem!