search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Coloring cells to indicate "today"

Asked by Jeremy
8 years ago.

HI. I am trying to work out how to color the cells for "today".
I do know I need to use "onBeforeCellRender" and then I look at "args.cell.start" but I cant seem to get it to evaluate correctly i.e if I go " if (args.cell.start == Date.now()) " it doesnt seem to work.
Am I doing the right thing?

Answer posted by Dan Letecky [DayPilot]
8 years ago.

In the Scheduler, you can use the following code:

dp.onBeforeCellRender = function(args) {
  if (args.cell.start <= DayPilot.Date.today() && DayPilot.Date.today() < args.cell.end) {
      args.cell.backColor = "#ffcccc";
  }
};

See also:
http://doc.daypilot.org/scheduler/highlighting-today/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.