Working with date format in template

IMO you don#t need the foreach loop in your php script because you have to do the same in your template

And to get the formated time, you'll have to use the date or datetime helper

All you need is
Code:
 <xen:datetime time="$thread.calendar_date"> /
 
Thank you for looking over the code, xf_phantom.

<xen:datetime> and <xen:date> both expect a UNIX time stamp as the variable, that's why I have the foreach loop in my PHP script. The database stores each calendar date as year_month_day format so it's super easy to query a range of dates. However I use the foreach to convert the date to UNIX time stamp prior to sending the information to the template because XenForo requires a UNIX time stamp date for proper output.
 
Top Bottom