I want to list all entries in a section by custom date time fields.
A training course has a From field and a To field. These fields are inside a Matrix field.
The field name storing this info is called trainingDateTime
.
The Matrix block is called trainingDateTimeDateTime
.
The Matrix fields in this block are called and dateTimeFrom
and dateTimeTo
both datetime fields.
My entries loop so far is:
{% set entries = craft.entries.section("training") %}
I know you can do order entries by a custom datetime field using something like:
{% set entries = craft.entries.section("training").customDateTime.('>= ' ~ now).order('customDateTime DESC') %}
But since I'm using a matrix field I'm unsure how to approach this.
I'm wanting to show all upcoming training courses from the current month up till the next 2 months.