-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Check if the TZID provided is an invalid time zone #144
Conversation
Re-worked your code in 5c30627 |
if($this->isValidTimeZoneId($dateArray[0]['TZID'])){ | ||
$dateTime->setTimezone(new \DateTimeZone($dateArray[0]['TZID'])); | ||
}else{ | ||
$dateTime->setTimezone($this->defaultTimeZone); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assume this should be $dateTime->setTimezone(new \DateTimeZone($this->defaultTimeZone));
$dateTime->setTimezone(new \DateTimeZone($dateArray[0]['TZID'])); | ||
}else{ | ||
$dateTime->setTimezone($this->defaultTimeZone); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time please abide by the PSR-2 standard already used by this repo
Thanks for the feedback! |
As mentioned at 668ea04 I wasn't able to parse my ICS files containing a non-valid DateTimeZoneId
W. Europe Standard Time
with https://github.com/u01jmg3/ics-parser/tree/v2.0.6, which reopened #116 for me. Since I assume that all changes were done on purpose and there was no mismatch between my composer-installed package and the v2.0.6 release I'm trying to offer this (hopefully none-intrusive) pull request!Any feedback is much appreciated, since I don't have a lot of experience with pull requests at all!
Best regards