diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-05 09:43:24 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-05 09:43:24 +0000 |
commit | 58a5eef53eee7768d68cc034a1563914d21a68cb (patch) | |
tree | e2e6dc48d8d5359acb72629e8ed805609c370345 /activesupport/lib/active_support/json | |
parent | 335c15005db47afe429d2ee27102dd646e3d43f6 (diff) | |
download | rails-58a5eef53eee7768d68cc034a1563914d21a68cb.tar.gz rails-58a5eef53eee7768d68cc034a1563914d21a68cb.tar.bz2 rails-58a5eef53eee7768d68cc034a1563914d21a68cb.zip |
Disambiguate Time, Date, and DateTime#to_json formatting. Closes #9750.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7746 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/json')
3 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/json/encoders/date.rb b/activesupport/lib/active_support/json/encoders/date.rb index de59e1b338..853d9b868c 100644 --- a/activesupport/lib/active_support/json/encoders/date.rb +++ b/activesupport/lib/active_support/json/encoders/date.rb @@ -1,5 +1,5 @@ class Date def to_json(options = nil) #:nodoc: - %("#{strftime("%m/%d/%Y")}") + %("#{strftime("%Y/%m/%d")}") end end diff --git a/activesupport/lib/active_support/json/encoders/date_time.rb b/activesupport/lib/active_support/json/encoders/date_time.rb index 229cefc007..f0b0434412 100644 --- a/activesupport/lib/active_support/json/encoders/date_time.rb +++ b/activesupport/lib/active_support/json/encoders/date_time.rb @@ -1,5 +1,5 @@ class DateTime def to_json(options = nil) #:nodoc: - %("#{strftime("%m/%d/%Y %H:%M:%S %Z")}") + %("#{strftime("%Y/%m/%d %H:%M:%S %z")}") end end diff --git a/activesupport/lib/active_support/json/encoders/time.rb b/activesupport/lib/active_support/json/encoders/time.rb index b9b52be9ed..8eb9ff132e 100644 --- a/activesupport/lib/active_support/json/encoders/time.rb +++ b/activesupport/lib/active_support/json/encoders/time.rb @@ -1,5 +1,5 @@ class Time def to_json(options = nil) #:nodoc: - %("#{strftime("%m/%d/%Y %H:%M:%S %Z")}") + to_datetime.to_json(options) end end |