CalendarDateRangePickerViewController icon indicating copy to clipboard operation
CalendarDateRangePickerViewController copied to clipboard

Single date selection added.

Open ajoykarmakar459 opened this issue 5 years ago • 1 comments

Previously I have found that we can select multiple dates with these awesome plugins but faced issues while selecting a single date. So I have changed some code in this swift file so the user can select single or multiple both dates. Please merge this code so I can directly fetch the updated code with "pod install" and I hope many users like me still facing the same issues. Best Regards, Ajoy Karmakar

ajoykarmakar459 avatar Feb 05 '20 13:02 ajoykarmakar459

if you need to use like dd.MM.yyyy-dd.MM.yyyy.

inside the CalendarDateRangePickerViewController.Swift file, navigate didTapDone() function and edit like this:

@objc func didTapDone() {
        if selectedStartDate != nil && selectedEndDate == nil{
            delegate.didTapDoneWithDateRange(startDate: selectedStartDate!, endDate: selectedStartDate!)
        }else if selectedStartDate == nil || selectedEndDate == nil {
            return
        }else{
            delegate.didTapDoneWithDateRange(startDate: selectedStartDate!, endDate: selectedEndDate!)
        }
    }

much easier and cleaner. just select a date, if user won't select second date, it will send both selectedStartDate

osmantufekci avatar Feb 20 '20 10:02 osmantufekci