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

Map Windows time zone IDs to their IANA equivalent #187

Merged
merged 2 commits into from
Oct 14, 2018
Merged

Map Windows time zone IDs to their IANA equivalent #187

merged 2 commits into from
Oct 14, 2018

Conversation

marcelstoer
Copy link
Contributor

Attempt to fix #186.

@u01jmg3 @jasonheffner WDYT?

@u01jmg3
Copy link
Owner

u01jmg3 commented Sep 28, 2018

I think you're on the right track albeit with a little tidy up. I would also double check PHP understands every conversion e.g. 'Etc/GMT+11'.

@marcelstoer
Copy link
Contributor Author

marcelstoer commented Sep 28, 2018

albeit with a little tidy up

Can you be more specific? I rarely code in PHP.

I asked myself whether it would be more efficient to first check for a Windows zone id in a TZID string before calling str_replace. Something like

foreach($needles as $needle){
  if (strpos($haystack, $needle) !== false) {
    return str_replace(...);
  }
}

However, AFAIU this won't make much difference anyhow.

double check PHP understands every conversion e.g. 'Etc/GMT+11'

It's my understanding that it does - you've already got that in your code: https://github.com/u01jmg3/ics-parser/blob/master/src/ICal/ICal.php#L1959. In fact, I started off by copying that CLDR array and then replaced the keys.

@marcelstoer marcelstoer changed the title WIP: Map Windows time zone ids to their IANA equivalent Map Windows time zone ids to their IANA equivalent Sep 29, 2018
@marcelstoer
Copy link
Contributor Author

@u01jmg3 We have been using it like this for 2w w/o issues. If you're still interested in accepting this PR then I would need guidance as per my previous comment. Otherwise I'll close it.

@u01jmg3
Copy link
Owner

u01jmg3 commented Oct 12, 2018

Thanks for the info. Keep it open and I shall take a look as soon as I have some time.

@u01jmg3 u01jmg3 changed the title Map Windows time zone ids to their IANA equivalent Map Windows time zone IDs to their IANA equivalent Oct 14, 2018
@u01jmg3 u01jmg3 merged commit 4b1ba16 into u01jmg3:master Oct 14, 2018
@u01jmg3 u01jmg3 added this to the v2.x.x milestone Oct 14, 2018
@marcelstoer marcelstoer deleted the feat/windows-zone-ids branch October 14, 2018 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows zone names not supported?
2 participants