I am using Timber/Twig and WordPress.
I have an Event Calendar created, and working, as well as a page displaying a full list of Events.
Something is buggy with my if statement now.
Only events from 2020/2021 between October and December show up.
Maybe someone has insight?
I've tested a few things and can't figure it out.
For clarification, this is setup so that if the date has passed, the event automatically doesn't show up.
{% if post.end_date|date('m-d-Y') >= now|date('m-d-Y') %}
...
{% endif %}
Thanks in advance.
You should format date to "Y-m-d" format.
If post.end_date is in 2021/01/01. Formatting into "m-d-Y" string results into "01-01-2021". Date now in "m-d-Y" format is "10-05-2020".
Comparing strings: