I’ve had no luck getting the Express Entries List block sorting against date correctly. So in one of my templates I found how to sort an EntryList type of a list of Express Entries for a specific Express Object. This is me sharing the method.
$eventSchedsEntity = Express::getObjectByHandle('event_schedules');
$listEventScheds = new Concrete\Core\Express\EntryList($eventSchedsEntity);
$listEventScheds->sortBy('ak_event_schedules_start', 'asc'); //'desc' is alternative value
Since I could not really find any actually complete example of this online, I had to cobble this together. The API documentation helped me come to this, but here’s some additional notes:
- I had to add “ak_” to the front of the ACTUAL handle of the Attribute I’m sorting by.
- The Attribute in this case is a Date+Time class Attribute (not just day).
- This looks to override whatever sorting the Express Entry List Block was set to (whether you want to override it or not is up to you).
So hopefully this helps someone else!