Hi,
Thanks a lot, I should have read up on using the callback functions.
If you could, could you suggest how to implement the noWeekends
function to this?
I have tried a few attempts below,
- $('#date').datepick({
- rangeSelect: true,
-
onDate: $.datepick.noWeekends,
- onDate: function(date) {
- return {selectable: !endRange ||
date.getTime() <= endRange.getTime()};
-
},
In this code, the noWeekends code looks to be
cancelled by the 2nd onDate function, if I put the noWeekends function
action the after the 2nd onDate function the range restriction gets cancelled.
So I attempted the multiple event handler, which looked like this:
- $('#date').datepick({
- rangeSelect: true,
-
onDate: $.datepick.multipleEvents(
$.datepick.noWeekends, function(date) {
- return {selectable: !endRange ||
date.getTime() <= endRange.getTime()};
-
}),
When I ran the code, this error appears in
the de-bugger,
Uncaught
TypeError: Cannot read property 'dateClass' of undefined
What would be the best way in combining the events?