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

add support for MS timezone names, and support for TZ not UTC (said ToDo) #114

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

sdetweil
Copy link
Contributor

@sdetweil sdetweil commented Sep 14, 2020

ms timezones are different from IANA. there is a table maintained by unicode.org that maps to IANA timezones. (xml format)

add post install to download and convert (using xml-js module) to json, so file is present if needed
add support to load table as lookup IF ms timezones are detected (they have spaces), and use it to map back to IANA

added test ics and testcase

use moment-timezone to set date per the ics w timezone, which gets date() in utc as required.
also handles (????+offset) timezones..

also TZID="america/pacific:20201005080000" (#65)

fixes #50 #65 #68 #76 #115

@sdetweil
Copy link
Contributor Author

i think this PR will fail for the same reason as #111 , as I add a dependency (install time, and a file to read at runtime)
I wasn't aware of the browser only intent.

function getIanaTZFromMS(msTZName){
if(!zoneTable){
const fs=require('fs')
const wtz=JSON.parse(fs.readFileSync(__dirname+"/windowsZones.json"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did not include the file windowsZones.json in your commit.

@sdetweil
Copy link
Contributor Author

@DennisGaida I don't understand.. its been in the repo for a long time.. I provided it back in 2020
when I pull the package from npmjs it is there

ical.js  LICENSE  node-ical.d.ts  node-ical.js  package.json  README.md  SECURITY.md  windowsZones.json

@sdetweil
Copy link
Contributor Author

i do not see the file in the current file list, but the last commit related to the the file was in 2021.

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

Successfully merging this pull request may close these issues.

Does not handle weird Google calendar timestamp + TZ combos
2 participants