Sha256: d5247f3adfb295a525a2f1f607e3512d5b068b1754d111972048bac7098c9b83

Contents?: true

Size: 316 Bytes

Versions: 25

Compression:

Stored size: 316 Bytes

Contents

class Date
  # Returns a JSON string representing the date.
  #
  # ==== Example:
  #   Date.new(2005,2,1).to_json
  #   # => "2005/02/01"
  def to_json(options = nil)
    if ActiveSupport.use_standard_json_time_format
      %("#{strftime("%Y-%m-%d")}")
    else
      %("#{strftime("%Y/%m/%d")}")
    end
  end
end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
activesupport-2.1.0 lib/active_support/json/encoders/date.rb
antfarm-0.3.0 rails/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb
antfarm-0.4.0 rails/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb
radiant-0.7.0 vendor/rails/activesupport/lib/active_support/json/encoders/date.rb
radiant-0.7.1 vendor/rails/activesupport/lib/active_support/json/encoders/date.rb