Make SimpleQueryEngine sort Dates correctly

Fixes #17068.