Add filterByDate function