Fix a logic bug in DatePair.isWithinPeriod()