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

[#5559] Do not black out the system timezone DST jump hour if Time.zone ... #5571

Merged
merged 1 commit into from May 15, 2012

Conversation

jarkko
Copy link
Contributor

@jarkko jarkko commented Mar 24, 2012

...differs from that.

The system timezone DST jump hour should not be blacked out by Time.zone.parse if current Time.zone does not do the jump at that time.

Fixes #5559.

…me.zone differs from that.

The system timezone DST jump hour should not be blacked out by Time.zone.parse if current Time.zone does not do the jump at that time.

Fixes rails#5559.
@ahawkins
Copy link

+1. I can't stand bugs like this. Props @jarkko

@jarkko
Copy link
Contributor Author

jarkko commented Apr 10, 2012

Pinging @tenderlove.

tenderlove added a commit that referenced this pull request May 15, 2012
[#5559] Do not black out the system timezone DST jump hour if Time.zone ...
@tenderlove tenderlove merged commit 1c3e5be into rails:master May 15, 2012
pixeltrix added a commit that referenced this pull request Dec 1, 2012
Chrome, Safari and Firefox serialize Date objects to strings such
as 'Mon May 28 2012 00:00:00 GMT-0700 (PDT)'. When these strings
are parsed the zone is interpreted as 'GMT-0700' which doesn't
exist in the TzInfo list of timezones.

By taking advantage of the improved date/time handling in 1.9.3
we can use `Date._parse` and the `:offset` value which is parsed
correctly.

Three tests were amended to make them pass:

1.  test_parse_with_old_date

    This needed changing to a different value because the original
    value was before EST was adopted so was being changed to a
    LMT (Local Mean Time) value after the change. It didn't before
    because `DateTime` just has offsets from UTC not timezones.

2.  test_parse_should_not_black_out_system_timezone_dst_jump

    Changed the implementation of this test as the stubs were
    dependent on internal implementation details of the test.
    Confirmed that the modified test still failed when the
    implementation of `parse` was restored to pre-#5571.

3.  test_parse_should_black_out_app_timezone_dst_jump

    Ditto.

Closes #5770.
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.

Time.zone.parse uses system TZ data for the DST jump even if Time.zone differs
3 participants