fix(orderBy): correctly order by date values

Closes #6675
Closes #6746