• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

xenforo locale ==> date problem

R

ragtek

Guest
#1
Hi, i'm trying to get this output in the template:

January 2010
April 2011
or at least
01-2010
04-2010
(or whatever you have in the US^^)
I've tried to add:
<td>{xen:date $stat.date, 'M.Y'}</td><td>{$stat.registrations}</td>
to the template, but it's not working

As i checked the method, which is responsible for this, i saw that it's not possible.
Do i really need to overwrite this method also, or is there a other way for this?:(
 
R

ragtek

Guest
#3
FYI, since beta6 it's possible

Date Formatting
It is now possible to fetch specific, absolute date elements in templates using the {xen:date} and {xen:time}functions. For example, if you want to output just the year for a given date variable, you can use {xen:date $dateVariable, 'Y'}.
 

Garani

Active member
#6
The 2nd parameter (format) only accepts these values: relative, absolute, monthDay, and picker.
Sorry to resurrect this thread. "picker" as in "Date Picker"?

I need to input some data and I did set up a DatePicker from jQuery on my own, though if the hoks are already within XenForo it wuld be useless to make the user load more garbage then necessary ;)
 

Kier

XenForo Developer
Staff member
#7
Sorry to resurrect this thread. "picker" as in "Date Picker"?

I need to input some data and I did set up a DatePicker from jQuery on my own, though if the hoks are already within XenForo it wuld be useless to make the user load more garbage then necessary ;)
Yes, we already implement one. You can see it in the date field of the search popup.

Using it is as simple as this:
HTML:
<input type="date" />
The XenForo JavaScript framework will do the rest.