Skip to content

Commit 66e78f1

Browse files
Add 'auto' option for timestamp times
1 parent 9ad9cbd commit 66e78f1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
{template timestamp timestamp time=no}<time datetime="{date($.const.DATE_W3C, $timestamp)}" title="{$timestamp|date_format:"%c"}">{$timestamp|date_format:tif($time, "%-d %b %Y&mdash;%I:%M %P", "%-d %b %Y")}</time>{/template}
1+
{template timestamp timestamp time=no}{strip}
2+
{if $time === 'auto'}
3+
{$time = tif(date('Hi', $timestamp) == '0000' ? false : true)}
4+
{/if}
5+
<time datetime="{date($.const.DATE_W3C, $timestamp)}" title="{$timestamp|date_format:"%c"}">
6+
{$timestamp|date_format:tif($time, "%-d %b %Y&mdash;%I:%M %P", "%-d %b %Y")}
7+
</time>
8+
{/strip}{/template}

0 commit comments

Comments
 (0)