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

Initialize Calendar to Show Start and End Time on Event

Related article: HTML5/JavaScript Event Calendar (Open-Source)
Asked by Anonymous
20 days ago.

How do I set the showEventStartEnd property of my calendar to true? I tried using this piece of code, but it’s not working for me.

const dp = new DayPilot.Calendar("dp", {
          theme: "business_theme",
          viewType: "Week",
          showEventStartEnd: "true",
          timeRangeSelectedHandling: "Enabled",
…
}
Answer posted by Dan Letecky [DayPilot]
19 days ago.

The showEventStartEnd property isn’t supported in the open-source version of the Calendar component at the moment.

However, you can customize the event content as needed using the onBeforeEventRender event:

{
  viewType: "Week",
  onBeforeEventRender: args => {
    const text = args.data.text;
    const start = args.data.start.toString("h:mm tt");
    const end = args.data.end.toString("h:mm tt");
    args.data.text = `${text} (${start} - ${end})`;
  }
}

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):