Skip to content

Commit

Permalink
fix: Use event timezone for allDay events
Browse files Browse the repository at this point in the history
Previously, the calendar time zone was always used, even if it was different or not set at all.
  • Loading branch information
sebbo2002 committed Mar 31, 2024
1 parent 176352c commit 1bfeaf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1666,9 +1666,9 @@ export default class ICalEvent {
this.swapStartAndEndIfRequired();
g += 'DTSTAMP:' + formatDate(this.calendar.timezone(), this.data.stamp) + '\r\n';
if (this.data.allDay) {
g += 'DTSTART;VALUE=DATE:' + formatDate(this.calendar.timezone(), this.data.start, true) + '\r\n';
g += 'DTSTART;VALUE=DATE:' + formatDate(this.timezone(), this.data.start, true) + '\r\n';
if (this.data.end) {
g += 'DTEND;VALUE=DATE:' + formatDate(this.calendar.timezone(), this.data.end, true) + '\r\n';
g += 'DTEND;VALUE=DATE:' + formatDate(this.timezone(), this.data.end, true) + '\r\n';
}

g += 'X-MICROSOFT-CDO-ALLDAYEVENT:TRUE\r\n';
Expand Down

0 comments on commit 1bfeaf6

Please sign in to comment.