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
1 month 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]
1 month 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})`;
  }
}

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