embedit
February 10, 2025, 8:02pm
1
Hi!
I am using CMS v4.2.0 and want to create a static template for a RSS ticker.
The template is working, except of the date format.
I want to change it to “DD.MM.YY H:i” but I don’t know where and how to do that.
This is my HBS:
Here what I see in the preview:
I would like to make it configurable in the layout editor with a field if possible:
How to realize that?
At least a correct formatting would be fine. The configuration is not mandatory
Thank you
embedit
February 11, 2025, 9:53am
2
My solution actually is in “onTemplateRender” tab:
var dateval = moment($(e).find('.date').text()).format(properties.itemDateFormat);
$(e).find('.date').text(dateval);
Isn’t it possible to set that in the twig tab or the HBS?
E.g.:
{{ date_time_variable | date("FORMAT_STRING", "OPTIONAL_TIMEZONE") }}
{{ date_time_variable | format_datetime(pattern: "dd.MM.yyyy, hh:mm") }}
system
Closed
May 13, 2025, 3:53pm
3
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.