Wizard Hugh helped me out with this funky bit of JS we use on an old Fabrik site..
To restrict some calendar dates on the calendar pop up.. This doesn't seem to work in the latest version of fabrik. Can someone help me out with this to get it working in the latest version please? Its currently a separate js file.
The ideal would be able to block
Dates less than 3 days away
All weekends
bank holidays (a simple array)
All dates more than 1 month away or dates not in this year
I've tried messing with the wiki examples but JS is just not a strength of mine.
Thanks in advance.
JavaScript:
function disallowDate(cal, date) {
var today = new Date;
var three_days = 1000 * 60 * 60 * 24 * 1;
dayDiff = date.getTime() - today.getTime();
if (dayDiff < three_days) {
return true;
}
date_array = [ '16-12-2016', '17-12-2016', ];
for (i=0; i < date_array.length; i++) {
if (date_array[i] == date.format('%d-%m-%Y')) {
return true;
}
}
return false;
}
To restrict some calendar dates on the calendar pop up.. This doesn't seem to work in the latest version of fabrik. Can someone help me out with this to get it working in the latest version please? Its currently a separate js file.
The ideal would be able to block
Dates less than 3 days away
All weekends
bank holidays (a simple array)
All dates more than 1 month away or dates not in this year
I've tried messing with the wiki examples but JS is just not a strength of mine.
Thanks in advance.