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

Why is some of the Calendar bar another color, sometimes?

Asked by Kim
12 days ago.

In my Calendar, the blue bar at the event edge is sometimes lighter (barBackColor?) in a small part . I know this is a behaviour that should show part-time-of-whole-time when in Scheduler, but why does it change "by itself" here? An example is the Badminton event on Wednesday in attached.

Answer posted by Dan Letecky [DayPilot]
12 days ago.

By default, the event boxes are aligned with the grid (useBoxes="Always", see also https://doc.daypilot.org/calendar/exact-event-duration/).

The duration bar is filled with the lighter color. The darker color highlights the real event duration.

That means if the event start and/or end don't match the cells part of the light background will be visible.

There are several ways to avoid that:

  • modify the css theme (set the duration bar background color to the same color - use https://themes.daypilot.org to generate a custom theme)
  • set the useEventBoxes property to "Never" - this will affect the event box size (it will shrink to match the real duration)

You can also customize the bar color and bar background color per event using onBeforeEventRender (https://doc.daypilot.org/calendar/event-customization/). Use args.data.barColor and args.data.barBackColor.

Comment posted by Kim
11 days ago.

Thanks Dan, Makes perfect sense.

New Reply
This reply is
Your name (optional):