public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Include time zone offset in TimeWithZone#to_json
Mon May 12 19:02:04 -0700 2008
rick (committer)
Tue May 13 09:50:45 -0700 2008
commit  f498f221bdd88a04458f56ee917c360bca833e94
tree    d7ca8c8cbc2265079106e1590396c07ccb4bb199
parent  74fd17346f30fddba0e174ae17f5697f2c22279e
...
78
79
80
81
 
82
83
84
...
78
79
80
 
81
82
83
84
0
@@ -78,7 +78,7 @@ module ActiveSupport
0
   
0
     def to_json(options = nil)
0
       if ActiveSupport.use_standard_json_time_format
0
-        utc.xmlschema.inspect
0
+        xmlschema.inspect
0
       else
0
         %("#{time.strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}")
0
       end
...
70
71
72
73
 
74
75
76
...
70
71
72
 
73
74
75
76
0
@@ -70,7 +70,7 @@ class TimeWithZoneTest < Test::Unit::TestCase
0
   
0
   def test_to_json_with_use_standard_json_time_format_config_set_to_true
0
     old, ActiveSupport.use_standard_json_time_format = ActiveSupport.use_standard_json_time_format, true
0
-    assert_equal "\"2000-01-01T00:00:00Z\"", @twz.to_json
0
+    assert_equal "\"1999-12-31T19:00:00-05:00\"", @twz.to_json
0
   ensure
0
     ActiveSupport.use_standard_json_time_format = old
0
   end

Comments