Adds technical date and time formatting

Adds options for technical date and time formatting and includes the option to show seconds.

Updates time formatting to use UTC-to-local conversion and ensures consistent colon separators for time values.

Adjusts all-day event handling to preserve original start/end times.
This commit is contained in:
Janus C. H. Knudsen 2025-10-03 16:05:22 +02:00
parent c8d78f472d
commit 38737762c5
7 changed files with 370 additions and 26 deletions

View file

@ -245,12 +245,8 @@ export class SwpAllDayEventElement extends BaseEventElement {
*/
private setAllDayAttributes(): void {
this.element.dataset.allDay = "true";
// For all-day events, preserve original start/end dates but set to full day times
const startDateStr = this.event.start.toISOString().split('T')[0];
const endDateStr = this.event.end.toISOString().split('T')[0];
this.element.dataset.start = `${startDateStr}T00:00:00`;
this.element.dataset.end = `${endDateStr}T23:59:59`;
this.element.dataset.allday = 'true';
this.element.dataset.start = this.event.start.toISOString();
this.element.dataset.end = this.event.end.toISOString();
}
/**