XF 2.0 Forcing full date/time information?

Jaxel

Well-known member
Doing this:
Code:
<xf:date time="{$thread.FirstPost.post_date}" />
Returns results such as:
Yesterday at 11:02 PM
Saturday at 1:31 PM
Dec 9, 2017

When a date gets older than a week, it gets rid of the "time" information. How do I force it to retain that time information? While maintaining the relative days like "Yesterday" and "Saturday".
 

Jaxel

Well-known member
Would there be an equivalent of:
Code:
{xen:time $article.article_date, 'M'}
{xen:time $article.article_date, 'd'}
?
 

DL6

Well-known member
Would there be an equivalent of:
Code:
{xen:time $article.article_date, 'M'}
{xen:time $article.article_date, 'd'}
?
Code:
{{ time($article.article_date, 'M') }}
{{ time($article.article_date, 'd') }}
 

Jaxel

Well-known member
Okay, what about getting just the TIME of a timestamp? (no date). I know I could use time(), but that would conform to defined date formats... which of course wouldn't respect a users 12/24 hour settings.
 

Mike

XenForo developer
Staff member
The time function in the templater defaults to the language's time format if you don't pass in a specific format.
 

marquisite

Well-known member
I presume you'd just need to edit the respective '_at_x' phrases, e.g. for yesterday_at_x:
Yesterday at {time} becomes Yesterday, {time}
 

dethfire

Well-known member
I presume you'd just need to edit the respective '_at_x' phrases, e.g. for yesterday_at_x:
Yesterday at {time} becomes Yesterday, {time}
oddly there is no day of the week phrase, no "monday at" or "tuesday at". Do you know where those are stored?
 
Top