我正在使用帮助程序 libaray “WWCalendarTimeSelector” GitHub 链接:- https://github.com/weilsonwonder/WWCalendarTimeSelector 我有一个用户注册日期,它是 29/9/2017。现在我只想启用下一个日期、月份和年份之间的日期。
当开始日期选择和未来日期选择其他日期禁用例如开始日期:- 29/09/2017 和未来日期选择 02/10/2017 看到之后的日期,你将被禁用......我该怎么做?请帮忙....
@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
}