I am looking for a working example of the format_date or format_datetime filters.
The problem:
I want to display just the day of a datetime property. We used to be able to do this with the deprecated filter |datetimeformat("%d"). Now we have the new |format_datetime filter - but nothing I try can make this work.
The only working example I could find was on the blog template of the Elevate theme in HubSpot github:
{{ content.publish_date|format_date('long') }}
But when I used pprint to check this property type it showed that the blog date type is actually:
(PyishDate: 2025-05-19 22:00:00)
The datetime type properties we get from crm records are string type, which seems to me like the issue. Is there a parse function that converts to PyishDate type - not finding anything on this...
I am looking for a pure HubL solution, I'm aware you can do this with javascript.
I understand that you’re having trouble displaying just the day from a datetime property in HubL using the new format_date or format_datetime filters, since CRM record datetime properties are strings rather than PyishDate objects, and you’re seeking a pure HubL solution for parsing and formatting these values.
I'd like to tag in some of our Top Contributors to see if they have any advice here -- Hi @MBERARD@Stephanie-OG and @Indra Do any of you have any tips or tricks for @Anders_Grové?
Thank you!
Cassie, Community Manager
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.