Moved count_by_day to get a date range.