method
time_tag
v4.2.7 -
Show latest stable
-
0 notes -
Class: ActionView::Helpers::DateHelper
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (38)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (-18)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
time_tag(date_or_time, *args, &block)
public
Returns an HTML time tag for the given date or time.
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> 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> <% end %> # => <time datetime="2010-11-04T17:55:45+01:00"><span>Right now</span></time>