โ04-21-2024 09:37 PM
Hello friends,
Hope you are all well. I need some liquid help from you. We are using a date from the canvas_entry_property i.e. {{canvas_entry_properties}}.${{creation_date}} and we want to use the {{creation_date}} to personalise our messaging for example "thanks your account is active with us since "yesterday", from "today", or from "tomorrow" else for future dates we want to call the {{creation_date}} with a filter to represent the date as 27 Apr etc. {{creation_date}} is in UTC format.
Appreciate some guidance here
Cheers
Raj
Solved! Go to Solution.
โ04-25-2024 07:35 AM
Hey Raj! Here's what I have so far. You'll most likely have to make format changes and also consider timezone differences. You can adjust the date inside "creation_date" to test different values.
{% assign creation_date = "2024-04-27" %}
{% assign creation_date_unix = creation_date | date: "%s" %}
{% assign today_unix = "now" | date: "%F" | date: "%s" %}
{% assign difference = creation_date_unix | minus: today_unix %}
{% if difference < 0 %}
Thank you for being a member with us since yesterday!
{% elsif difference == 0 %}
Thank you for being a member with us since today!
{% elsif difference <= 86400 %}
Thank you for being a member with us starting tomorrow!
{% elsif difference > 86400 %}
Thank you for being a member with us starting {{creation_date}}!
{% endif %}
โ04-25-2024 07:35 AM
Hey Raj! Here's what I have so far. You'll most likely have to make format changes and also consider timezone differences. You can adjust the date inside "creation_date" to test different values.
{% assign creation_date = "2024-04-27" %}
{% assign creation_date_unix = creation_date | date: "%s" %}
{% assign today_unix = "now" | date: "%F" | date: "%s" %}
{% assign difference = creation_date_unix | minus: today_unix %}
{% if difference < 0 %}
Thank you for being a member with us since yesterday!
{% elsif difference == 0 %}
Thank you for being a member with us since today!
{% elsif difference <= 86400 %}
Thank you for being a member with us starting tomorrow!
{% elsif difference > 86400 %}
Thank you for being a member with us starting {{creation_date}}!
{% endif %}
โ04-28-2024 07:07 PM
TY for this @AllanHeo , works perfectly ๐
a month ago
Love to hear that!