I want to use a property called “birthday” in my marketing email. It’s field type is Date Picker. If I used it by default like
{{contact.birthday}}
it shows something like “30/11/20” which is super confusing to recipients. I want to show it in long/medium form like “30 September 2020”. I’ve tried adding it as
I would prefer if this could be done using Hubl, but if not hopefully a calculated property works? I don’t want to push 2 different properties using api for essentially the same thing, cause it’s going to be a hassle to manage properties if we want different date formats.
If I see an unexpcted result I use pprint to debug:
{{ contact.birthday|pprint }}
You make need to create a fallback (or an “if” loop) for when the date is not know.
Have fun
Mike
Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of Webalite a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.
Yes, I have tried using “dd MMMM yyyy” and other variants, and none of them show anything. Also tried format_datetime just in case.
Have tried pprint. {{ contact.birthdate|format_date(‘d MMMM yyyyy’)|pprint }} prints nothing. While {{ contact.birthdate|pprint }} shows (String: 30/11/20). Just want to reiterate tho, the property is a “date picker” type. Honestly, I’m stumped and there really should be an easy way to do this.
I do not believe the formatting works like that in HubSpot for the date picker property. Depending on your subscription you might be able to build a custom coded workflow that would create it in a single line of text property.