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

Multiple background colors in event (Scheduler)

Asked by Ankit - concentics@gmail.com
10 months ago.

Hello,

Anyone, please help me

How to set multiple background colors in any event hour wise

eg:- an event name is event-1 and the event start time is 2 pm and the event end time is 9 pm now I want red background color from 2 pm to 4 pm and blue background color from 4 pm to 6 pm and yellow background color from 6 pm to 9 pm in a single event

how can I do this ….

Answer posted by Dan Letecky [DayPilot]
10 months ago.

You can do this by inserting custom active areas into Scheduler events.

The start and end of an active area can be specified using date/time values instead of pixels. That will let you insert custom time segments.

See also an example in the event phases page of the documentation:

onBeforeEventRender: (args) => {
  const start = new DayPilot.Date(args.data.start);
  const end = new DayPilot.Date(args.data.end);
  args.data.areas = [
      {start: start, end: start.addDays(3), top: 0, bottom: 0, backColor: "#6AA84F", html: "Preparation", fontColor: "white"},
      {start: start.addDays(3), end: end.addDays(-3), top: 0, bottom: 0, backColor: "#38761D", html: args.data.text, fontColor: "white"},
      {start: end.addDays(-3), end: end, top: 0, bottom: 0, backColor: "#274E13", html: "Cleanup", fontColor: "white"},
  ];
}

You can also combine it with custom resize drag handles to add warm-up and cool-down periods to an event.

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