Skip to content

Commit abcccf3

Browse files
committed
Allow to choose only one date
1 parent 7964e90 commit abcccf3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

CalendarDateRangePickerViewController/Classes/CalendarDateRangePickerViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ public class CalendarDateRangePickerViewController: UICollectionViewController {
6464

6565
@objc func didTapDone() {
6666
if selectedStartDate == nil || selectedEndDate == nil {
67-
return
67+
if let selectedStartDate = selectedStartDate {
68+
delegate.didPickDateRange(startDate: selectedStartDate, endDate: selectedStartDate)
69+
} else {
70+
return
71+
}
6872
}
6973
delegate.didPickDateRange(startDate: selectedStartDate!, endDate: selectedEndDate!)
7074
}

0 commit comments

Comments
 (0)