Added function definition for `filter_dates`