Question about sorting by date
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the reported supersort('rsortAs', ...) calls with the combinedExhibitionEntries data and the exhibitionDate values shown in the issue. Read the existing rsortAs behavior and template examples, then confirm a working date-sorting syntax or document the limitation; no source file or test is named.
Written by the indexing model from the issue text.
Description
Hi,
I'm using supersort to try and sort the entries on this page:
https://catrionajeffries.com/artists/valerie-blass/exhibitions
The entries are a combined array of objects. I'm outputting each date into a data attribute on each exhibition:

I would like to order these by most recent date to oldest on the page, but I haven't figured out a way to do this yet.
Have tried various combinations of passing the date into the sort function, but nothing has worked.
{% set sortedExhibitionEntries = combinedExhibitionEntries | supersort('rsortAs', '{exhibitionDate.first.date|date}') %}
{% set sortedExhibitionEntries = combinedExhibitionEntries | supersort('rsortAs', '{{object.exhibitionDate.first.date|date}') %}}
{% set sortedExhibitionEntries = combinedExhibitionEntries | supersort('rsortAs', '{{object.exhibitionDate.date|date}') %}}
I've tried it with and without the date filter, all sorts of other syntax, but it never seems to properly sort by date.
Wondering if anybody might have any insight into the proper syntax here? exhibitionDate does exist for each object, as evidenced by the data attribute in the above screenshot.
Thanks!
- Dominant language
- PHP
- Stars
- 41
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TopShelfCraft/SuperSort
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
TopShelfCraft/SuperSort#15 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
TopShelfCraft/SuperSort#13 ·
All issues in TopShelfCraft/SuperSort
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Opensync-en
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Opensync-en
Difficulty 2/5 1-2 days Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
feature-request needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-sdk-php#3365 ·
Maintainers usually reply within 1 day