XF 2.3 Date format for custom thread fields

frm

Well-known member
I am getting YYYY-MM-DD when calling a custom thread field.

I thought there'd be something like {$variable|number} for formatting dates with |date and took inspiration from member profiles seeing the date() function, but nothing worked.

Is there a way to format it to MMM DD, YYYY? Or any other formats?
 
Solution
Not sure if this is what you want but:
Code:
This showns 2024-09-26 formated as 26.09.2024 (using the visitor timezone)<br />
{{ date(date_from_format('Y-m-d', '2024-09-26'), 'd.m.Y') }}
Not sure if this is what you want but:
Code:
This showns 2024-09-26 formated as 26.09.2024 (using the visitor timezone)<br />
{{ date(date_from_format('Y-m-d', '2024-09-26'), 'd.m.Y') }}
 
  • Like
Reactions: frm
Solution
Nope, but that gave me a close enough clue to do this:
{{ date(date_from_format('Y-m-d', $user.Profile.custom_fields.testDate), 'M d, Y') }}

For Sep 12, 2024 in my suggestion example.
 
Back
Top Bottom