mirror of
https://github.com/github/rails.git
synced 2026-02-09 21:55:24 -05:00
Time#to_json uses Numeric#to_utc_offset_s to output cross-platform-consistent representation without having to convert to DateTime. References #9750
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8636 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Time#to_json uses Numeric#to_utc_offset_s to output a cross-platform-consistent representation without having to convert to DateTime. References #9750 [Geoff Buesing]
|
||||
|
||||
* Refactor number-to-HH:MM-string conversion logic from TimeZone#formatted_offset to a reusable Numeric#to_utc_offset_s method. [Geoff Buesing]
|
||||
|
||||
* Continue evolution toward ActiveSupport::TestCase. #10679 [Josh Peek]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Time
|
||||
def to_json(options = nil) #:nodoc:
|
||||
to_datetime.to_json(options)
|
||||
%("#{strftime("%Y/%m/%d %H:%M:%S")} #{utc_offset.to_utc_offset_s(false)}")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user