This project is archived and is in readonly mode.
Helper for HTML5 time tag
Reported by s-andringa | November 4th, 2010 @ 06:32 PM
Since other html 5 related helpers are being added as well I thought it'd be nice to also have a convenient helper method for generating a time tag, that automatically deals with setting the datetime attiribute and optionally the contents.
The patch below makes this possible:
time_tag Date.today # =>
<time datetime="2010-11-04">November 04, 2010</time>
time_tag Time.now # =>
<time datetime="2010-11-04T17:55:45+01:00">November 04, 2010 17:55</time>
time_tag Date.yesterday, 'Yesterday' # =>
<time datetime="2010-11-03">Yesterday</time>
time_tag Date.today, :pubdate => true # =>
<time datetime="2010-11-04" pubdate="pubdate">November 04, 2010</time>
Comments and changes to this ticket
-
s-andringa November 4th, 2010 @ 06:39 PM
- no changes were found...
-
s-andringa November 5th, 2010 @ 07:58 AM
- Tag changed from date, helper, html5, tag, time to date, helper, html5, patch, tag, time
-
Ches Martin December 11th, 2010 @ 08:16 PM
I think it'd be really nice if this took an option parameter for the I18n format.
-
Repository February 13th, 2011 @ 12:24 AM
- State changed from new to resolved
(from [95a5bd87cb542c534b7f2490dcfa687a1bfeec43]) Added time_tag helper to AP for HTML5 time tag [#5919 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/95a5bd87cb542c534b7f2490dcfa6... -
Josh Kalderimis February 13th, 2011 @ 12:27 AM
- Importance changed from to Low
Hi Sjoerd,
Thanks for the patch, I added a small enhancement to allow for the format to be set via an options argument.
Keep up the great patching!
Josh
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 5919 Helper for HTML5 time tag (from [95a5bd87cb542c534b7f2490dcfa687a1bfeec43]) Added t...