| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Make strptime behave more like parse when components are missing and
share behavior between the two methods.
|
|
|
|
| |
This makes it easier to parse user-inputted times as from a given time zone.
|
|
|
|
|
| |
Conflicts:
activesupport/lib/active_support/values/time_zone.rb
|
|
|
|
|
| |
Since real timezone is loaded anyway in `#utc_offset`
which is called during `#create`
|
|
|
|
|
|
| |
Hash#keys.each allocates an array of keys; Hash#each_key iterates through the
keys without allocating a new array. This is the reason why Hash#each_key
exists.
|
|
|
|
|
| |
It’s used at so many places that extracting it out into a helper file
is worth doing.
|
| |
|
|
|
|
|
| |
Namely, if the mday is omitted but any other upper components are, then instead
of supplying the mday from the current time, it defaults to 1.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rails applications are expected to be always aware of the application
time zone.
To be consistent with that contract, we have to assume that a bare
date passed to time helpers is a date in the application time zone,
not in the system time zone. The system time zone is irrelevant, we
should totally ignore it.
For example,
travel_to user.birth_date + 40.years
should make that user be 40th years old regardless of the system
time zone. Without this patch that may not be true.
|
|
|
|
|
|
| |
This behavior is only work out-of-box with minitest and also add a
downside to run after each test case, even if we don't used the travel
or travel_to methods
|
|
|
|
|
|
|
| |
Ruby's Date class automatically gives us #yesterday, #today,
and #tomorrow. And ActiveSupport has a handy Time.zone.today
for getting a localized version. But there was no localized
version of #yesterday or #tomorrow. Until now.
|
| |
|
|
|
|
|
| |
The bug with `ActiveSupport::TimeZone.parse` described in #9678 was
unwittingly fixed in 005d910 so add some tests to prevent regression.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
format strings.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
|
|
|
|
|
| |
[#4942 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
| |
[#4942]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
[#4652 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
| |
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
|
|
|
|
|
|
| |
when hour < 0 and not in hundreds [#3741 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
[#1617 state:resolved]
|
|
|
|
| |
ActiveSupport [#1914 state:resolved]
|
| |
|
|
|
|
| |
up-to-date
|
|
|
|
| |
offsets to more current date
|
|
|
|
| |
[#195 state:resolved]
|
|
|
|
| |
ActiveSupport [#238 state:resolved]
|
|
|
|
| |
familiar to end users (see time zone selects used by Windows OS, google.com and yahoo.com.) Reverts [8370]
|
| |
|
|
|
|
| |
string. Eliminate creation of additional TimeWithZone instance to determine utc offset.
|
|
|
|
| |
attribute methods use Time.zone.parse instead of to_time
|
|
|
|
|
|
| |
bundled
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9150 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
|
|
| |
result in TimeZone instance
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|