xenforo locale ==> date problem

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
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?:(
 
{xen:date $stat.date, 'M.Y'}
The 2nd parameter (format) only accepts these values: relative, absolute, monthDay, and picker. So no you can't pass a format you would normally pass to php's date() function.

Do i really need to overwrite this method also, or is there a other way for this?
You can always create your own template helper!
 
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'}.
 
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 ;)
 
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.
 
Top Bottom