Skip to content

Commit

Permalink
feat(Event): Handle timezone('UTC') correctly
Browse files Browse the repository at this point in the history
closes #328
  • Loading branch information
sebbo2002 committed Nov 8, 2021
1 parent c0745e5 commit 781dc3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ export default class ICalEvent {
* event.timezone('America/New_York');
* ```
*
* @see https://github.com/sebbo2002/ical-generator#-date-time--timezones
* @since 0.2.6
*/
timezone(timezone: string | null): this;
Expand All @@ -438,7 +439,7 @@ export default class ICalEvent {
return this.calendar.timezone();
}

this.data.timezone = timezone ? timezone.toString() : null;
this.data.timezone = timezone && timezone !== 'UTC' ? timezone.toString() : null;
if (this.data.timezone) {
this.data.floating = false;
}
Expand Down

0 comments on commit 781dc3d

Please sign in to comment.