Close the calendar automatically if a range other than custom is chosen