I am trying to use the “datetimeformat” filter on a contact field of the Date picker field type. The issue I’m having is the filter is not recognizing the value of the property as a datetime data type, which I’m assuming it requires in order to work properly.
Here is an example of how I’m using it trying to display the month:
The value of {{ contact.appointment_date }} without any filtering displays as mm/dd/yyyy format.
I feel as though I can’t be the only one experiencing this issue but I cant find any documentation on it either.
Same here. Documentation on this is horrible. It tells you to first apply “strtotime” for properties that aren’t set as a datetime timestamp. Hubspot date picker properties, I believe, aren’t datetime but date only. But the strtotime documentation is horrible as well. All it says is “Converts a datetime string and a datetime format into a datetime object.” but that doesn’t help me jack squat.
I’ve got a date property referenced and just want to apply formatting to only show the year:
I had the same issue. I used ‘date’ instead of ‘datetime’. The filter wasn’t working in Design Manager. Tried to convert ‘strtotime’ and back to datetimeformat. However …
{{ contact.appointment_date|datetimeformat(‘%B’)}} does work, not in template preview but in a draft or a published page. When you set the time in CMS page edit mode, the datetime is set correctly from the date picker and the filter works.