refactored to accept only date objects