1. 19 9月, 2015 1 次提交
  2. 15 9月, 2015 1 次提交
    • A
      Improve Docs of ActiveSupport::TimeZone [ci skip] · 4818f3e1
      amitkumarsuroliya 提交于
      `TimeZone` class is a part of `ActiveSupport` module. For Accessing `TimeZone` class, we need to call `ActiveSupport::TimeZone` instead of `TimeZone`.
      
      individual `TimeZone` gives `NameError: uninitialized constant ‘TimeZone’ error
      4818f3e1
  3. 23 4月, 2015 3 次提交
    • A
      Improve ActiveSupport::TimeWithZone conversion to YAML · 3aa26cfb
      Andrew White 提交于
      Previously when converting AS::TimeWithZone to YAML it would be output
      as a UTC timestamp. Whilst this preserves the time information accurately
      it loses the timezone information. This commit changes that so that it is
      saved along with the time information. It also provides nicer encoding of
      AS::TimeZone instances themselves which previously embedded all of the
      data from the TZInfo records.
      
      Fixes #9183.
      3aa26cfb
    • A
      Refactor ActiveSupport::Timezone#strptime · 5302d244
      Andrew White 提交于
      Make strptime behave more like parse when components are missing and
      share behavior between the two methods.
      5302d244
    • P
      Add ActiveSupport::TimeZone#strptime. · a5e507fa
      Paul A Jungwirth 提交于
      This makes it easier to parse user-inputted times as from a given time zone.
      a5e507fa
  4. 09 3月, 2015 1 次提交
    • A
      Revert "Take DST into account when locating TimeZone from Numeric." · 34b27701
      Andrew White 提交于
      Reverting this as it's not the implementation that we would like it to be.
      This is being used inside of ActiveSUpport::TimeZone[] and it's unaware
      of the context in which to find the timezone period so the timezone found
      changes depending on whether DST is in effect for the current period.
      This means that `'2001-01-01'.in_time_zone(-9)` changes from winter/summer
      even though it's the same date that we're trying to convert.
      
      Since finding timezones by numeric offsets is a bit hit and miss we should
      introduce a new API for finding them which supplies the date context in
      which we want to search and we should probably also deprecate the finding
      of timezones via the [] method, though this needs further discussion.
      
      This reverts commit 2cc2fa36.
      34b27701
  5. 04 3月, 2015 1 次提交
  6. 07 2月, 2015 1 次提交
  7. 14 1月, 2015 1 次提交
  8. 05 1月, 2015 1 次提交
  9. 29 11月, 2014 1 次提交
  10. 06 10月, 2014 1 次提交
  11. 30 8月, 2014 1 次提交
    • A
      reduce object allocations in utc_offset · 365aa654
      Aaron Patterson 提交于
      `try` allocates an array on every call, we should avoid calling it in
      hotspots.  This reduced AttributeMethodsTest#test_setting_time_zone_aware_attribute_with_string
      from 18k allocations to 14k
      365aa654
  12. 18 5月, 2014 1 次提交
  13. 11 5月, 2014 2 次提交
  14. 14 3月, 2014 1 次提交
  15. 27 1月, 2014 1 次提交
    • A
      Maintain current timezone when changing time during DST overlap · b5944928
      Andrew White 提交于
      Currently if a time is changed during DST overlap in the autumn then the
      method `period_for_local` will return the DST period. However if the
      original time is not DST then this can be surprising and is not what is
      generally wanted. This commit changes that behavior to maintain the current
      period if it's in the list of periods returned by `periods_for_local`.
      
      It is possible to alter the behavior of `period_for_local` by specifying a
      second argument but since we may be change from another time that could be
      either DST or not then this would give inconsistent results.
      
      Fixes #12163.
      b5944928
  16. 10 1月, 2014 1 次提交
  17. 02 1月, 2014 1 次提交
    • A
      Don't lazy load the tzinfo library · 75ad0e64
      Andrew White 提交于
      Lazy loading the tzinfo library doesn't really buy us anything because
      the gem is installed as a dependency via the gemspec and if a developer
      is using Active Support outside of Rails then they can cherry pick which
      files to load anyway.
      
      Fixes #13553
      75ad0e64
  18. 03 12月, 2013 2 次提交
  19. 07 8月, 2013 3 次提交
  20. 12 4月, 2013 1 次提交
  21. 27 3月, 2013 1 次提交
  22. 12 3月, 2013 1 次提交
  23. 10 3月, 2013 1 次提交
  24. 11 12月, 2012 1 次提交
    • A
      Deprecate obsolete Time to DateTime fallback methods · 48583f8b
      Andrew White 提交于
      The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time
      methods were added to handle the limitations of Ruby's native Time
      implementation. Those limitations no longer apply so we are deprecating
      them in 4.0 and they will be removed in 4.1.
      48583f8b
  25. 05 12月, 2012 1 次提交
    • C
      Replace comments' non-breaking spaces with spaces · 019df988
      claudiob 提交于
      Sometimes, on Mac OS X, programmers accidentally press Option+Space
      rather than just Space and don’t see the difference. The problem is
      that Option+Space writes a non-breaking space (0XA0) rather than a
      normal space (0x20).
      
      This commit removes all the non-breaking spaces inadvertently
      introduced in the comments of the code.
      019df988
  26. 02 12月, 2012 1 次提交
    • A
      Only take the date parts from Time.zone.now · c89b6c4c
      Andrew White 提交于
      When there are missing components in the Hash returned by
      Date._parse only the date components should default to the
      value of Time.zone.now, the time components should all
      default to zero.
      c89b6c4c
  27. 01 12月, 2012 1 次提交
    • A
      Make `Time.zone.parse` to work with JavaScript date strings · 005d9106
      Andrew White 提交于
      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.
      005d9106
  28. 02 11月, 2012 1 次提交
  29. 15 9月, 2012 1 次提交
  30. 01 7月, 2012 1 次提交
  31. 14 5月, 2012 1 次提交
  32. 01 5月, 2012 2 次提交
  33. 14 4月, 2012 1 次提交
    • D
      Correcting some confusion. Pago Pago is part of American Samoa, not Samoa.... · 1d08ce5f
      Dave Gerton 提交于
      Correcting some confusion. Pago Pago is part of American Samoa, not Samoa. Further, Samoa and Tokelau jumped across the IDL from Dec 29 to Dec 31, 2011 switching from UTC-11 to UTC+13. American Samoa did not make the change and remains at UTC-11. Pacific/Fakaofo and Pacific/Apia are in TZInfo and documentation about the dateline change is in austalasia at IANA.
      1d08ce5f