Date selection logic.