Order matrix blocks by date field I'm using a matrix inside a Super Table to organize events, and I'd like to order the events using the date field for each event.

I'm currently showing the first five events using limit then using offset to show the rest of the blocks after the first five. Then I'm separating future and past events using the date field. Like this:

First five upcoming events:

{% for block in block.eventList.limit(5) %}
     {% if block.eventDate &gt;= now %}
          {{ block.eventTitle }}
     {% endif %}
{% endfor %}


The rest of the upcoming events:

{% for block in block.eventList.offset(5) %}
     {% if block.eventDate &gt;= now %}
          {{ block.eventTitle }}
     {% endif %}
{% endfor %}


All past events:

{% for block in block.eventList %}
     {% if block.eventDate &lt;= now %}
          {{ block.eventTitle }}
     {% endif %}
{% endfor %}


This works fine as is, but it doesn't sort the events within the sections by the date field. How can I add that?
I hope I am not completely missing the point, but I guess like that:

Initial 5:

{% for block in block.eventList.eventDate('&gt;=' ~ (now|atom)).orderBy('eventDate asc').limit(5).all() %}
     {{ block.eventTitle }}
{% endfor %}


rest:

{% for block in block.eventList.eventDate('&gt;=' ~ (now|atom)).orderBy('eventDate asc').offset(5).all() %}
          {{ block.eventTitle }}
{% endfor %}


past events:

{% for block in block.eventList.eventDate('&lt;' ~ (now|atom)).orderBy('eventDate desc').all() %}
     {{ block.eventTitle }}
{% endfor %}


you will probably need to change the date('Y-m-d') format