-
Notifications
You must be signed in to change notification settings - Fork 359
Parse time zones when creating schedules from ICAL; fix DST test bug #295
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8db090e
Parse time zones when creating schedules from ICAL; fix DST test bug …
barelyknown f754169
Add correct offset without changing time
johnhamelink f03e439
Add spec which proves hour doesn't change when timezone is set
johnhamelink f62f55f
Merge pull request #1 from johnhamelink/from_ical_time_zone
barelyknown 7bd414a
Merge remote-tracking branch 'upstream/master' into from_ical_time_zone
dcosson 204d3b3
Merge pull request #2 from dcosson/from_ical_time_zone
barelyknown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is actually inconsistent with ice_cube's behavior for
to_ical
. Ice_cube's to_ical uses the%Z
strftime string which (at least for en_US based locale's, behavior may be different elsewhere) outputs a string likePDT
which is effectively a utc offset not a timezone (PDT= UTC - 7 hours vs PST = UTC - 8 hours).But
ActiveSupport::TimeZone.new
requires an actual timezone, either the Olson format timezone such asAmerica/Los_Angeles
or the other version ofPacific Time (US & Canada)
(which is some US only format that I don't even know if it's a standard with a name). Furthermore, there's not an ActiveSupport method for going from a timezone offset like PDT to a region's timezone because they're not the same thing.So, in order for this PR to really make sense in the library, the
to_ical
method should be changed to use the.time_zone.name
property of ActiveSupport::TimeWithZone instead of the strftime string.I checked the ical RFC and it does not specify timezone identifiers, but says
Implementers may want to use the naming conventions defined in existing time zone specifications such as the public-domain TZ database [TZDB]
and links to the olson timzone database