Problems in the media browser: not sorting by last modified

Sorting in the media browser does not work. When I select “last modified”, it does not sort the elements by date in descending order, but leaves them unordered. Sorting by file size does work.

ModX 3.1.2
PHP 8.3

Does the value for the “Last Modified” field display correctly in the media browser?
There has been an issue on Github recently that I couldn’t reproduce.

What values do you use for the system settings manager_date_format and manager_time_format on your MODX installation?

manager_time_format = H:i
manager_date_format = d.m.Y

It’s a bug in MODX that was introduced with version 3.1.0.

I created a issue for it on Github:

Basically the files used to be sorted by the timestamp (which is a number).
Now the files get sorted by the already formatted datetime-string. This only works correctly if the default system setting values are used (like Y-m-d for manager_date_format). But fails when other values are used, as the sorting is now alphabetically.