Sorting with dates is not correctly functioning with CMS Combine

Hi @Support-Luis, When I use CMS Combine attribute. I’m combining “News” and “Events” collection and would like to sort them out with dates.

Combining is working but when you check out the dates of events/news the sorting is not correctly functioning

Share Link

Thanks a lot

Hey @barrybaris! The best way would be to use CMS Sort along CMS Combine. Here is a link to a clonable we’ve made using this combo → CMS Sort + CMS Combine | Attributes.

You’ll have to add the custom code on the clonable page, the date field to your collection items and the corresponding CMS Sort setup for sorting by dates.

Let me know if you need help once you add these to the setup! :muscle:

This doesn’t seem to be sorting correctly. I cloned your example, gave it a date field, and it persists in sorting alphabetically (April, February, October, etc).

I had the same problem on my site: 2 CMS collections combined; sorting by name did work – sorting by “updated” (date) did not work. Turned out, that the date-format “D/M/YYYY” was the problem.

:ballot_box_with_check: Changed to “M/D/YYYY” (in a hidden field) solved the problem. Even with using weglot.


Thank you for sharing @simon1!

@_theclevernod let me know if Simon’s solution works for your project!