Closed siebird closed 4 years ago
Hey @siebird, that seems to be working on my end. I adapted your code a bit to use content from my test section:
{% set conferenceSchedule = craft.entries.section('events').all() %}
{% for day, scheduleByDay in conferenceSchedule|group("eventdate.start|date('l, F jS')") %}
<div>{{ day }}</div>
{% for track in scheduleByDay %}
<div>{{ track.title }} - {{ track.eventdate.start | date('g:i') }} - {{ track.eventdate.end | date('g:i a') }}</div>
{% endfor %}
{% endfor %}
And that returns:
Wednesday, April 8th
Event 2 - 3:30 - 12:00 pm
Tuesday, March 3rd
Event 1 - 2:30 - 2:30 am
I did change the 5th line to use the eventDate
field from the track, not from the entry.
Doh 🤦♂️ I was using the wrong date range field. I have a few. Working now
Trying to group entries by day and I'm not sure if it's possible or just using the wrong syntax. This just outputs the current day. I also tried the
.formatted
function too