Changed how to test if a date is in a given range