Permalink
Browse files

Include time zone offset in TimeWithZone#to_json

  • Loading branch information...
1 parent 74fd173 commit f498f221bdd88a04458f56ee917c360bca833e94 @danielmorrison danielmorrison committed with rick May 13, 2008
@@ -78,7 +78,7 @@ def xmlschema
def to_json(options = nil)
if ActiveSupport.use_standard_json_time_format
- utc.xmlschema.inspect
+ xmlschema.inspect
else
%("#{time.strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}")
end
@@ -70,7 +70,7 @@ def test_to_json
def test_to_json_with_use_standard_json_time_format_config_set_to_true
old, ActiveSupport.use_standard_json_time_format = ActiveSupport.use_standard_json_time_format, true
- assert_equal "\"2000-01-01T00:00:00Z\"", @twz.to_json
+ assert_equal "\"1999-12-31T19:00:00-05:00\"", @twz.to_json
ensure
ActiveSupport.use_standard_json_time_format = old
end

0 comments on commit f498f22

Please sign in to comment.