XF 1.1 XenForo Date Question from a Custom User Field

robdog

Well-known member
I have a user field that asks the user "Fan Since:" and they have to enter a date like 2010-10-04.

I want to pass that into this function or something similar to that:
{xen:date $user.customFields.packer_fan_since}

But that appears to want a timestamp. Is there a date format function that takes YYYY-MM-DD in XenForo Templates?

Thanks.
 
I thought the call backs were only for validation. You can convert the data within the callback for custom user fields? Because if that is the case, I am golden.
 
I thought the call backs were only for validation. You can convert the data within the callback for custom user fields? Because if that is the case, I am golden.

What do you want to accomplish with your custom field? Which template are you working in? You likely wouldn't define a callback for the custom field. Rather you would create an appropriate listener to perform the date operation where it's needed in the templates.
 
Basically I trying to have the users input a date (2011-10-01) and convert it to a timestamp when it is saved into the DB so it can be used in the <xen:date /> template command. However, this would not work, because editing that value again would need to convert from timestamp to YYYY-MM-DD. So to simplify the process, I just had them input a 4 digit year, lol.
 
Top Bottom