Fix bug in ordering datedTasks