Move isWithinPeriod method from Logic to DatePair/Task.

Note that no test is created yet.