Changeset 9203 for trunk/activesupport/lib/active_support/json
- Timestamp:
- 04/01/08 20:25:26 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/lib/active_support/json/encoders/date_time.rb
r9093 r9203 6 6 # # => "2005/02/01 15:15:10 +0000" 7 7 def to_json(options = nil) 8 %("#{strftime("%Y/%m/%d %H:%M:%S %z")}") 8 if ActiveSupport.use_standard_json_time_format 9 xmlschema.inspect 10 else 11 %("#{strftime("%Y/%m/%d %H:%M:%S %z")}") 12 end 9 13 end 10 14 end trunk/activesupport/lib/active_support/json/encoders/date.rb
r9093 r9203 6 6 # # => "2005/02/01" 7 7 def to_json(options = nil) 8 %("#{strftime("%Y/%m/%d")}") 8 if ActiveSupport.use_standard_json_time_format 9 %("#{strftime("%Y-%m-%d")}") 10 else 11 %("#{strftime("%Y/%m/%d")}") 12 end 9 13 end 10 14 end trunk/activesupport/lib/active_support/json/encoders/time.rb
r9093 r9203 6 6 # # => 2005/02/01 15:15:10 +0000" 7 7 def to_json(options = nil) 8 %("#{strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}") 8 if ActiveSupport.use_standard_json_time_format 9 utc.xmlschema.inspect 10 else 11 %("#{strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}") 12 end 9 13 end 10 14 end