i am using the helper libaray "WWCalendarTimeSelector" GitHub link :- https://github.com/weilsonwonder/WWCalendarTimeSelector I have a date for registration of user and it's 29/9/2017. Now I want to only enable dates between next date, month and year.
when starting date select and future date select other date disable for example starting date :- 29/09/2017 and future date select 02/10/2017 Seeing the date after that, you will be disable... How can I do that ? please help....
@IBAction func btnSelectClick(_ sender: Any) {
let selector = UIStoryboard(name: "WWCalendarTimeSelector", bundle: nil).instantiateInitialViewController() as! WWCalendarTimeSelector
selector.delegate = self
selector.optionCurrentDate = singleDate
selector.optionCurrentDates = Set(multipleDates)
selector.optionCurrentDateRange.setStartDate(multipleDates.first ?? singleDate)
selector.optionCurrentDateRange.setEndDate(multipleDates.last ?? singleDate)
selector.optionStyles.showDateMonth(true)
selector.optionStyles.showMonth(false)
selector.optionStyles.showYear(true)
selector.optionStyles.showTime(false)
present(selector, animated: true, completion: nil)
}
func WWCalendarTimeSelectorDone(_ selector: WWCalendarTimeSelector, date: Date) {
print("Selected \n\(date)\n---")
singleDate = date
dateLabel.text = date.stringFromFormat("d' 'MMMM' 'yyyy', 'h':'mma")
}
func WWCalendarTimeSelectorDone(_ selector: WWCalendarTimeSelector, dates: [Date]) {
print("Selected Multiple Dates \n\(dates)\n---")
if let date = dates.first {
singleDate = date
dateLabel.text = date.stringFromFormat("d' 'MMMM' 'yyyy', 'h':'mma")
}
else {
dateLabel.text = "No Date Selected"
}
multipleDates = dates
}