Fix invalid tasks size when fromDate or toDate changes