I am trying to filter orders until a specific cutoff date on our member accounts page. Here is my approach:
{% paginate customer.orders by 20 %} {% assign ordersThresholdDate = ‘2020-04-07’ | date: ‘%s’ %} {% assign orderDate = order.created_at | date: ‘%s’ %}
{% if orderDate >= ordersThresholdDate %} (display orders and such) {% endif %}
The part of the code I am having trouble with, spits out nothing:
{% assign orderDate = order.created_at | date: ‘%s’ %}
It seems like the date filter doesn’t work on this object variable at all, which doesn’t make much sense to me… How can I get the value I am looking for, or is there a better method for what I am trying to do?
Thanks!