Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting timezone as UTC creates strange behaviour #328

Closed
pezza3434 opened this issue Nov 7, 2021 · 4 comments
Closed

Setting timezone as UTC creates strange behaviour #328

pezza3434 opened this issue Nov 7, 2021 · 4 comments

Comments

@pezza3434
Copy link

Hi there,

Thanks for a maintaining this great package, I've been using it for a few years. I've just upgraded to the latest version from 1.4.3.

Just a heads up, that setting the timezone to utc:

const cal = ical({ domain: "eventcalendarapp.com", name: calendarName, timezone: "UTC", method: "publish" });

Stops the DTStart and DTEnd dates from being created with a 'Z' at the end. Which if I understand correctly makes them floating times.

Removing the timezone solves the issue, and reading the readme and the code it seems if no timezone is stated then it is handled in UTC time. Just a bit strange behaviour.

Apologies for being lazy and not doing a pull request.

Thanks again for a great package.

@pezza3434
Copy link
Author

Related to this, if you set UTC as a timezone for an event, the dates become 'TZID=UTC 2021blahblah'. I'm not sure if setting the TZID on an event to utc is ever valid based on this from the spec:

"This parameter MUST be specified on the "DTSTART",
"DTEND", "DUE", "EXDATE", and "RDATE" properties when either a
DATE-TIME or TIME value type is specified and when the value is
neither a UTC or a "floating" time."

I could be wrong, I haven't researched the issue in huge detail.

@sebbo2002
Copy link
Owner

Removing the timezone solves the issue, and reading the readme and the code it seems if no timezone is stated then it is handled in UTC time. Just a bit strange behaviour.

Currently UTC is the default and therefore does not need a call to timezone(). The call with timezone('UTC') currently causes incorrect output, I would now note this here as a bug. The correct call for UTC would be timezone(null) or no call at all.

@sebbo2002 sebbo2002 added the bug label Nov 7, 2021
@sebbo2002 sebbo2002 self-assigned this Nov 7, 2021
@sebbo2002 sebbo2002 mentioned this issue Nov 8, 2021
github-actions bot pushed a commit that referenced this issue Nov 8, 2021
# [3.1.0-develop.2](v3.1.0-develop.1...v3.1.0-develop.2) (2021-11-08)

### Features

* **Calendar:** Handle `timezone('UTC')` correctly ([c0745e5](c0745e5)), closes [#328](#328)
* **Event:** Handle `timezone('UTC')` correctly ([781dc3d](781dc3d)), closes [#328](#328)
@sebbo2002
Copy link
Owner

🎉 This issue has been resolved in version 3.1.0-develop.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Nov 17, 2021
# [3.1.0](v3.0.1...v3.1.0) (2021-11-17)

### Bug Fixes

* Remove Blob usage to support modern browsers ([c4e33d3](c4e33d3)), closes [#325](#325)

### Features

* **Calendar:** Handle `timezone('UTC')` correctly ([c0745e5](c0745e5)), closes [#328](#328)
* **event:** Add support for event class ([a227aa2](a227aa2))
* **Event:** Handle `timezone('UTC')` correctly ([781dc3d](781dc3d)), closes [#328](#328)
@sebbo2002
Copy link
Owner

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants