diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-13 02:10:13 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-13 02:10:13 -0200 |
commit | 944d314244676932eb1aa285d23f7d91f0678e68 (patch) | |
tree | 804bd0d58e1b3311bbab5df02f68e26df7e0100d /activesupport/lib/active_support/core_ext/date/conversions.rb | |
parent | fbd917f50a6046d02dd6a64ccfb1aed0cbce68d8 (diff) | |
download | rails-944d314244676932eb1aa285d23f7d91f0678e68.tar.gz rails-944d314244676932eb1aa285d23f7d91f0678e68.tar.bz2 rails-944d314244676932eb1aa285d23f7d91f0678e68.zip |
Add Date#rfc3339 and Date#iso8601 to AS
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date/conversions.rb')
-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 06d868a3b0..769ead9544 100644 --- a/activesupport/lib/active_support/core_ext/date/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date/conversions.rb @@ -93,6 +93,12 @@ class Date ::DateTime.civil(year, month, day, 0, 0, 0, 0) end if RUBY_VERSION < '1.9' + def iso8601 + strftime('%F') + end if RUBY_VERSION < '1.9' + + alias_method :rfc3339, :iso8601 if RUBY_VERSION < '1.9' + def xmlschema to_time_in_current_zone.xmlschema end |