tags:

views:

11

answers:

1

I've added the calendar from http://www.dynarch.com/projects/calendar/old/ onto my wordpress site. It loads fine but I don't want people to select dates in the past which I've managed to do but want to add a strikethrough but don't know how. Please help. Thanks

A: 

http://www.dynarch.com/static/jscalendar-1.0/doc/html/reference.html#node_sec_5.3.7

You need your own disabled date handler

For example

function disallowDate(date) {
  // date is a JS Date object
  var d=new Date();
  if (  date.getTime() < d.getTime()) {
    return true; // disable anything less than today
  }
  return false; // enable other dates
};

calendar.setDisabledHandler(disallowDate);
mplungjan
You MAY need to normalise:var d=new Date();d.setHours(0,0,0,0);date.setHours(0,0,0,0);
mplungjan