I have a site using teh Calendar as a date picker. there are 2 date pickers on teh same page. this has been working for the past 9 months with no issues. all of a sudden it started throwing the following error in all browsers
TypeError: ‘undefined’ is not a function (evaluating ‘t[q].getFullYear()’)
the page is sacobound.com/reservations.php
I don’t understand what’s going on since I have not changed anything. any ideas would be appreciated.
thanks so much
an observation:
I just realized that whichever of the two date picker objects is initialized first works, however the second one does not! here is the loader code:
function doOnLoad() {
var sacoboundCalendar;
var fiddleheadCalendar;
fiddleheadCalendar = new dhtmlXCalendarObject(["calendarFiddlehead"]);
fiddleheadCalendar.setDateFormat("%m/%d/%Y");
fiddleheadCalendar.hideTime();
fiddleheadCalendar.setInsensitiveDays(["<?php echo $FiddleheadBlackoutDates ?>"]);
// alert("<?php echo $FiddleheadBlackoutDates ?>");
var myEvent = fiddleheadCalendar.attachEvent("onChange", function (){
//event handler code
reservationCalculation();
// alert("change");
})
sacoboundCalendar = new dhtmlXCalendarObject(["calendarSacobound"]);
sacoboundCalendar.setDateFormat("%m/%d/%Y");
sacoboundCalendar.hideTime();
sacoboundCalendar.setInsensitiveDays(["<?php echo $SacoboundBlackoutDates ?>"]);
var myEvent = sacoboundCalendar.attachEvent("onClick", function (){
//event handler code
reservationCalculation();
})
}
it appears that if there is no value for SetInsensitiveDate, this error will appear. I have created the following check which seems to resolve the issue. HOWEVER I cannot seem to set the dates as unavailable. I will create a separate post for this.
function doOnLoad() {
var sacoboundCalendar;
var fiddleheadCalendar;
fiddleheadCalendar = new dhtmlXCalendarObject(["calendarFiddlehead"]);
fiddleheadCalendar.setDateFormat("%m/%d/%Y");
fiddleheadCalendar.hideTime();
// check to see if there are any blackout dates
fiddleheadBlackoutDates = '2013-04-01,2013-04-20,2013-04-22';
if (fiddleheadBlackoutDates > ''){
fiddleheadCalendar.setInsensitiveDays(["2013-04-01,2013-04-20,2013-04-22"]);
alert("FiddleheadBlackoutDates: 2013-04-01,2013-04-20,2013-04-22");
}
var myEvent = fiddleheadCalendar.attachEvent("onChange", function (){
//event handler code
reservationCalculation();
// alert("change");
})
sacoboundCalendar = new dhtmlXCalendarObject(["calendarSacobound"]);
sacoboundCalendar.setDateFormat("%m/%d/%Y");
sacoboundCalendar.hideTime();
// check to see if there are any blackout dates
SacoboundBlackoutDates = '';
if (SacoboundBlackoutDates > ''){
sacoboundCalendar.setInsensitiveDays([""]);
alert("SacoboundBlackoutDates: ");
}else{
alert("no SacoboundBlackoutDates");
}
var myEvent = sacoboundCalendar.attachEvent("onClick", function (){
//event handler code
reservationCalculation();
})
}
I meant to say SetInsensitiveSays.
sorry…