Fixed searchBetweenDates method