Refactored the isActive method to support a range of dates