$("#calendar1").wijcalendar({ beforeSelect: function (e, data) { var selDates = $("#calendar1").wijcalendar('option', 'selectedDates'), selected = false, list; $.each(selDates, function (i, d) { if (data.date.getFullYear() === d.getFullYear() && data.date.getMonth() === d.getMonth() && data.date.getDate() === d.getDate()) { selected = true; return false; } ); if (selected) { $("#calendar1").wijcalendar('unSelectDate', data.date); } else { $("#calendar1").wijcalendar('selectDate', data.date); } list = $("#msg").empty(); selDates = $("#calendar1").wijcalendar('option', 'selectedDates'); $.each(selDates, function (i, d) { var li = $("<li/>"); li.text(d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate()); list.append(li); }); return false; } });