Fixed start_date end_date reversed check for periods