Disabling a certain day of week

Make a suggestion or contribution to Epoch Prime here

Disabling a certain day of week

Postby nick on Wed Sep 27, 2006 10:22 am

This function will blackout all instances of the given day and prevent the user from selecting them. You can insert it at the end of the createCalCells() method.

Code: Select all
/**
* Blackout all instances of bkday (0:monday to 6:sunday)
* @param int bkday
*/
function blackoutDay(bkday) {
  var noDates = new Array();
  var idx = 0;
  for(var i=0;i< self.cells.length;i++) {
    if(self.cells[i].date.getDay() == bkday) {
      noDates[idx] = new Date(cells[i].date);
      noDates[idx].canSelect = false;
      idx++;
    }
  }
  self.addDates(noDates);
}
nick
 
Posts: 156
Joined: Sun Apr 23, 2006 12:14 pm

Return to Working with Epoch Prime

Who is online

Users browsing this forum: No registered users and 1 guest

cron