statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Array sort is only affected by first field #2403

Closed danielfowler closed 5 years ago

danielfowler commented 5 years ago

{{ auditions sort="day:asc|time:asc" }} will sort by the day key within auditions, but not time

To Reproduce YAML:

auditions:
  -
    day: 2019-05-14
    time: 07:00
  -
    day: 2019-05-13
    time: 16:00
  -
    day: 2019-05-14
    time: 22:00
  -
    day: 2019-05-14
    time: 16:00

HTML:

{{ auditions sort="day:asc|time:asc" }}
<li>{{ day }} @ {{ time }}</li>
{{ /auditions }}

Expected behavior

Screenshots Ignore the end times, that's a separate value not included above because it's irrelevant. image

Environment details (please complete the following information):

Additional context Add any other context about the problem here.