frm
Well-known member
I suggest enhancing the
Referenced formatting: https://www.php.net/manual/en/function.date.php.
For the
As for the
I understand we're working with just the
Currently, it appears that we're stuck with the 2024-09-12 (Y-m-d/YYYY-MM-DD) format in custom fields without the ability to modify it, despite attempts to replicate the
I may be wrong here, but I posed the question with no response and tried to replicate different formats as seen throughout various templates to no avail, so there might be a way to do it that I'm just not seeing.
If there isn't a way to modify a custom user date input, then please expand
Edit: Alternatively, you could store the date selected as a UNIX timestamp without hours, minutes, seconds, ... instead of Y-m-d. such as
date()
template function to support PHP-style formatting, or modifying the <xf:date>
conditional to include date
and format
attributes (while retaining time
for where it's already used). This would allow it to recognize custom user field dates set in the format 2024-09-12
, and format them as something like "September 12, 2024" or "Sep 12, 24", making them more consistent with other dates seen across XenForoReferenced formatting: https://www.php.net/manual/en/function.date.php.
For the
date()
function, it could work similarly to PHP, where you could use date($custom_field, 'F j, Y')
to output a formatted date like "September 12, 2024".As for the
<xf:date>
conditional, it could have a format
attribute for something like "F j, Y", and be used like <xf:date date="$custom_field" format="F j, Y" />
.I understand we're working with just the
Y-m-d
format for user-selected dates in custom fields and the options for formatting are limited since it's not a full timestamp (i.e., we can't include hours, minutes, seconds). However, as it stands, there’s no way to format these dates in a consistent or visually appealing way, similar to dates seen in user profiles (e.g., Join date or Birthday).Currently, it appears that we're stuck with the 2024-09-12 (Y-m-d/YYYY-MM-DD) format in custom fields without the ability to modify it, despite attempts to replicate the
date()
function and <xf:date>
conditional (which seems to only accept timestamps with the time
attribute) used in other templates.I may be wrong here, but I posed the question with no response and tried to replicate different formats as seen throughout various templates to no avail, so there might be a way to do it that I'm just not seeing.
If there isn't a way to modify a custom user date input, then please expand
date()
or <xf:date>
for this ability.Edit: Alternatively, you could store the date selected as a UNIX timestamp without hours, minutes, seconds, ... instead of Y-m-d. such as
1726099200
for September 12, 2024.
Last edited:
Upvote
0