Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8636

Show
Ignore:
Timestamp:
01/12/08 21:02:46 (6 months ago)
Author:
gbuesing
Message:

Time#to_json uses Numeric#to_utc_offset_s to output cross-platform-consistent representation without having to convert to DateTime. References #9750

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r8635 r8636  
    11*SVN* 
     2 
     3* Time#to_json uses Numeric#to_utc_offset_s to output a cross-platform-consistent representation without having to convert to DateTime. References #9750 [Geoff Buesing] 
    24 
    35* Refactor number-to-HH:MM-string conversion logic from TimeZone#formatted_offset to a reusable Numeric#to_utc_offset_s method. [Geoff Buesing] 
  • trunk/activesupport/lib/active_support/json/encoders/time.rb

    r7746 r8636  
    11class Time 
    22  def to_json(options = nil) #:nodoc: 
    3     to_datetime.to_json(options
     3    %("#{strftime("%Y/%m/%d %H:%M:%S")} #{utc_offset.to_utc_offset_s(false)}"
    44  end 
    55end