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

Need to support Windows timezones #14

Closed
derekantrican opened this issue Jul 18, 2018 · 4 comments
Closed

Need to support Windows timezones #14

derekantrican opened this issue Jul 18, 2018 · 4 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@derekantrican
Copy link
Owner

derekantrican commented Jul 18, 2018

Example ICAL from a user (generated from Microsoft Outlook):

BEGIN:VEVENT
DESCRIPTION:Test sync
UID:040000008200E00074C5B7101A82E00800000000C0F85EF4991CD401000000000000000
010000000D8D1B7BF8927144E9F2E19D9CBAEF85C
SUMMARY:Test
DTSTART;TZID=Mountain Standard Time:20180716T080000
DTEND;TZID=Mountain Standard Time:20180716T090000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20180716T034238Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

Note how the timezones are "Mountain Standard Time". This is a Windows way of representing the timezone and is not supported by Moment.js (which uses IANA timezone formats)

It's also somewhat important to note that when Moment can't match a timezone, it assumes the datetime is in UTC

@derekantrican derekantrican added the enhancement New feature or request label Jul 18, 2018
@derekantrican
Copy link
Owner Author

derekantrican commented Jul 18, 2018

This will probably be useful: https://github.com/chrisdavies/js-windows-timezones/blob/master/win-timezones.js

And this may be even more useful (see the second table, a direct mapping of Windows timezone to TZID): http://unicode.org/cldr/charts/32/supplemental/zone_tzid.html

@arjanvdberg
Copy link

I think this is the same issue as #3 . There should be a VTIMEZONE section in the ICAL that defines the timezone. The "Mountain Standard Time" is just a reference to this VTIMEZONE block.

@derekantrican
Copy link
Owner Author

@arjanvdberg Looks like you were right - this is the same as #3

Here is this user's VTIMEZONE section

BEGIN:VTIMEZONE
TZID:Mountain Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE

@derekantrican derekantrican added the duplicate This issue or pull request already exists label Jul 19, 2018
@derekantrican
Copy link
Owner Author

Closing as a duplicate of #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants