Don't show old post message if there's no date

This commit is contained in:
Oliver Davies 2021-07-01 21:47:29 +01:00
parent f39e685395
commit 8f144754bc

View file

@ -1,6 +1,9 @@
{% macro shouldDisplayOldPostMessage(post) %}
{% set cutOffDate = 'today -1 year'|date('U') %}
{{ post.date <= cutOffDate }}
{% if post.date is not empty %}
{{ post.date <= cutOffDate }}
{% endif %}
{% endmacro %}
{% import _self as helpers %}