diff options
author | Anton Davydov <antondavydov.o@gmail.com> | 2015-05-21 02:03:41 +0300 |
---|---|---|
committer | Anton Davydov <antondavydov.o@gmail.com> | 2015-05-21 02:03:41 +0300 |
commit | 30f831804776df7d659f868baf0d257ad58fbffa (patch) | |
tree | 996536cb066b9dcdddc206aa3230a600d271e133 /activesupport | |
parent | f271f43f1059982e4e43c29ba2f8abc974ba0ea8 (diff) | |
download | rails-30f831804776df7d659f868baf0d257ad58fbffa.tar.gz rails-30f831804776df7d659f868baf0d257ad58fbffa.tar.bz2 rails-30f831804776df7d659f868baf0d257ad58fbffa.zip |
[skip ci] Update documentation for Date class
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/conversions.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/conversions.rb b/activesupport/lib/active_support/core_ext/date/conversions.rb index df419a6e63..31479a1269 100644 --- a/activesupport/lib/active_support/core_ext/date/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date/conversions.rb @@ -35,6 +35,7 @@ class Date # date.to_s(:db) # => "2007-11-10" # # date.to_formatted_s(:short) # => "10 Nov" + # date.to_formatted_s(:number) # => "20071110" # date.to_formatted_s(:long) # => "November 10, 2007" # date.to_formatted_s(:long_ordinal) # => "November 10th, 2007" # date.to_formatted_s(:rfc822) # => "10 Nov 2007" @@ -82,6 +83,11 @@ class Date ::Time.send(form, year, month, day) end + # Returns a string which represents the time in used time zone as DateTime + # defined by XML Schema: + # + # date = Date.new(2015, 05, 23) # => Sat, 23 May 2015 + # date.xmlschema # => "2015-05-23T00:00:00+04:00" def xmlschema in_time_zone.xmlschema end |