Skip to content

Commit

Permalink
CALENDAR: add enddate to ensure events with overlapping days generate…
Browse files Browse the repository at this point in the history
… an entry
  • Loading branch information
mascaldotfr committed Jun 4, 2024
1 parent 6d8b6f6 commit 32f05cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/libs/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export function generate_calendar(tstamp, title, duration) {
let starttime = [sdate.getUTCHours(), sdate.getUTCMinutes()];
starttime = zeropad(starttime);
let edate = new Date(tstamp * 1000 + duration * 1000);
let enddate = [edate.getUTCFullYear(), edate.getUTCMonth() + 1, edate.getUTCDate()];
enddate = zeropad(enddate);
let endtime = [edate.getUTCHours(), edate.getUTCMinutes()];
endtime = zeropad(endtime);
return `
Expand All @@ -48,6 +50,7 @@ export function generate_calendar(tstamp, title, duration) {
name="[CoR] ${title.toUpperCase()}"
startDate="${startdate.join("-")}"
startTime="${starttime.join(":")}"
endDate="${enddate.join("-")}"
endTime="${endtime.join(":")}"
timeZone="UTC"
options="'Apple','Google','iCal','Outlook.com','Yahoo','Microsoft365'"
Expand Down
2 changes: 1 addition & 1 deletion js/menu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 32f05cf

Please sign in to comment.