aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorRyan Glover <ersatzryan@gmail.com>2013-11-07 10:35:49 -0500
committerRyan Glover <ersatzryan@gmail.com>2013-11-07 10:43:51 -0500
commita64d4e85e311edfcea79c777c6a184dc408c2f57 (patch)
tree5247af7249feb18faff8cbe04c090fca910848b6 /activesupport/lib/active_support
parent0fca7d67d4b748584e589bea69db1988b3138cb0 (diff)
downloadrails-a64d4e85e311edfcea79c777c6a184dc408c2f57.tar.gz
rails-a64d4e85e311edfcea79c777c6a184dc408c2f57.tar.bz2
rails-a64d4e85e311edfcea79c777c6a184dc408c2f57.zip
Standardize all JSON encoded times to use 3 decimal fractional seconds
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/object/json.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/json.rb b/activesupport/lib/active_support/core_ext/object/json.rb
index 7c8daebd3d..898c3f4307 100644
--- a/activesupport/lib/active_support/core_ext/object/json.rb
+++ b/activesupport/lib/active_support/core_ext/object/json.rb
@@ -180,7 +180,7 @@ end
class Time
def as_json(options = nil) #:nodoc:
if ActiveSupport.use_standard_json_time_format
- xmlschema
+ xmlschema(3)
else
%(#{strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)})
end
@@ -200,7 +200,7 @@ end
class DateTime
def as_json(options = nil) #:nodoc:
if ActiveSupport.use_standard_json_time_format
- xmlschema
+ xmlschema(3)
else
strftime('%Y/%m/%d %H:%M:%S %z')
end