I'm trying to add 30 days to a pre-order date and if today's date is later, display a text string and if not display another text string. Any ideas where I'm going wrong?
{% assign assign pre_date = 259200 | plus: order.created_at | date: '%s' %}
{% assign today_date = 'now' | date: '%s' %}
{% if pre_date > today_date %}
disply this
{% else %}
this
{% endif %}
{% assign assign pre_date = 259200 | plus: order.created_at | date: '%s' %}? Operations are performed left-to-right, so it's trying to take your base offset and add whatever order.created_at is (which may not be a number, so may be returning0), then converting that result to a date-in-seconds. I have a feeling that you want to change the order toorder.created_at | date: '%s' | plus: 259200so that you're definitely adding a number to a string-that-can-be-coerced-into-a-number. :) - Dave Bdatefilter returns a string, you may need to coercetoday_dateto an integer by using{% assign today_date = 'now' | date: '%s' | times: 1 %}in order to get the comparison to work properly - Dave B