I have a list of events which should list each event until midnight of said day.
So If a gig happens at 17:00 it should still be visible until midnight of the same day.
I came relatively close (I guess) but it's not working:
{% set nocturne = now|date_modify('today 00:00') %}
{% set midnight = nocturne|date('Y-m-d H:i') %}
This should set {{ midnight }}
to midnight of the current day.
Then I translate the custom date field of each gig into the same format as {{ mdinight }}
{% set getFirstGig = craft.entries.section('gigEntry').first() %}
{% set gigDate = getFirstGig.konzertDatum|date('Y-m-d H:i') %}
Then I want to call the whole thing:
{% set upcoming = craft.entries.section('gigEntry').gigDate('>= ' ~midnight) %}
{% for entry in upcoming %}
<h2>{{ entry.title }}</h2>
{% endfor %}
The code actualy works but my test entry with the time 17:00 is not displayed here. What am I missing? And is there a neater way of writing things?