myCalendar.setSensitiveRange fails with custom date format

Hi :slight_smile:

I am having problems with setting sensitive range of dates (I want all past dates to be deactvated when loading the page with the calendar. It will be used for a booking system. Booking for the past makes no sense. I can always validate the input by other means, but it would not be user friendly.

Here is the code run when the page loads:

function doOnLoad() {
myCalendar = new dhtmlXCalendarObject([“dato1”, “dato2”]);
myCalendar.loadUserLanguage(“no”);
myCalendar.setDateFormat(“%l - %d - %m - %Y”);
//myCalendar.setPosition(‘left’);
//debug
myCalendar.setSensitiveRange(“2012-09-04”,NULL);
}

Yes, a popup calendar linked to 2 different input tags.

Maybe there could also be some issue with my custom interface language ??

I hope I can resolve this :slight_smile:

Per

I have fixed the issue. I simply set the range BEFORE setting custom date format.

As a further enhancement i split it into 2 different calendars, 1 for each input tag. This way the calendars correctly remember selected date. Otherwise it won’t work with cuctom date formatting. Oh well …

Per