Show endDate for calendar events

when dateHeader is enabled and showEnd is set to true
This commit is contained in:
rejas 2022-05-10 21:44:15 +02:00
parent d730dd04bf
commit c3b2aaec69

View File

@ -305,6 +305,12 @@ Module.register("calendar", {
timeWrapper.className = "time light align-left " + this.timeClassForUrl(event.url);
timeWrapper.style.paddingLeft = "2px";
timeWrapper.innerHTML = moment(event.startDate, "x").format("LT");
// Add endDate to dataheaders if showEnd is enabled
if (this.config.showEnd) {
timeWrapper.innerHTML += " - " + moment(event.endDate, "x").format("LT");
}
eventWrapper.appendChild(timeWrapper);
titleWrapper.classList.add("align-right");
}