Start and end dates are not always correct because the places query is not sorted by timestamps.

Added a unit test that fails without sorting and passes with sorting.