aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-02-21 23:33:36 -0800
committerAndrew White <andyw@pixeltrix.co.uk>2013-02-21 23:33:36 -0800
commit31f807c7aaaf12c16ea1572559c00f49d54d6f43 (patch)
tree8fa60a4ff996076492ce7008608c5ff724439795 /actionpack/lib/action_view
parentb5df957af122991360f273eca5d2a3bf710e40d6 (diff)
parentdc142f9cd4d6341df28350ef4065c40f21e1f586 (diff)
downloadrails-31f807c7aaaf12c16ea1572559c00f49d54d6f43.tar.gz
rails-31f807c7aaaf12c16ea1572559c00f49d54d6f43.tar.bz2
rails-31f807c7aaaf12c16ea1572559c00f49d54d6f43.zip
Merge pull request #9334 from NARKOZ/time_tag
use ISO 8601 format in time_tag helper
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index a989966613..d3953c26b7 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -642,6 +642,8 @@ module ActionView
# <time datetime="2010-11-03">Yesterday</time>
# time_tag Date.today, pubdate: true # =>
# <time datetime="2010-11-04" pubdate="pubdate">November 04, 2010</time>
+ # time_tag Date.today, datetime: Date.today.strftime('%G-W%V') # =>
+ # <time datetime="2010-W44">November 04, 2010</time>
#
# <%= time_tag Time.now do %>
# <span>Right now</span>
@@ -651,7 +653,7 @@ module ActionView
options = args.extract_options!
format = options.delete(:format) || :long
content = args.first || I18n.l(date_or_time, :format => format)
- datetime = date_or_time.acts_like?(:time) ? date_or_time.xmlschema : date_or_time.rfc3339
+ datetime = date_or_time.acts_like?(:time) ? date_or_time.xmlschema : date_or_time.iso8601
content_tag(:time, content, options.reverse_merge(:datetime => datetime), &block)
end