Initialize Calendar to Show Start and End Time on Event
Asked by Anonymous
1 years 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 years 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 month old and has been closed. Please create a new question if you have anything to add.