I am using the NoGray Calendar
and have the following code:
my_cal1 = new ng.Calendar({
input: {date:\'date1\', month:\'month1\', year:\'year1\'
You can use the method is_selectable
http://www.nogray.com/api/calendar/is_selectable.php to check if the dates are selectable or not. The is_selectable
returns an array [true|false, 'reason']. Below is a quick example
my_cal1 = new ng.Calendar({
input: {date:'date1', month:'month1', year:'year1'},
selected_date:new Date(),
display_date:new Date(),
dates_off:[{date:22, month:6}], // you were messing a ] here
events: {
onDateClick: function(dt){
this.select_date(dt);
},
// code to check if the start date is selectable
onLoad: function(){
var st_dt = this.get_start_date().clone();
while(!this.is_selectable(st_dt)[0]){
st_dt = st_dt.from_string('today + 1');
}
// checking if no dates are selected
if (!ng.defined(this.get_selected_date())){
this.select_date(st_dt);
}
this.set_start_date(st_dt);
}
}
});