Correctly sort by date in the listing module (see #5609)