Query database in javascript calendar date blocker

nycreate

Member
Hi all, hoping someone can help me with this one...

Hugh, the jedi master wrote this script for me a while ago to dissallow dates in the calendar....

Code:
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 = ['31-03-2012', '01-04-2012'];
   for (i=0; i < date_array.length; i++) {
       if (date_array[i] == date.format('%d-%m-%Y')) {
          return true;
      }
   }
   return false;
}

which works very well but I would like to change the date_array so it queries a list.

list will have 2 elements date and description, so i want it just to check if the date exists in the list and block that date...

Thanks in advance.
 
you would need to do a userAjax call to the server to run the database query and then return the results.
Take a look at components/com_fabrik/user_ajax_example.php for further docs regarding this
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top