Open 429329513wanting opened 4 years ago
//MARK: - calendarDelegate func startDate() -> Date {
var dateComponents = DateComponents()
dateComponents.month = -1
let today = Date()
let threeMonthsAgo = self.calendarView?.calendar.date(byAdding: dateComponents, to: today)!
return threeMonthsAgo!
}
func endDate() -> Date {
var dateComponents = DateComponents()
dateComponents.month = 12
let today = Date()
let twoYearsFromNow = self.calendarView?.calendar.date(byAdding: dateComponents, to: today)!
return twoYearsFromNow!
}
func calendar(_ calendar: CalendarView, didScrollToMonth date: Date) {
}
func calendar(_ calendar: CalendarView, didDeselectDate date: Date) {
}
func headerString(_ date: Date) -> String? {
return "标题"
}
func calendar(_ calendar: CalendarView, didSelectDate date: Date, withEvents events: [CalendarEvent]) {
}
func calendar(_ calendar: CalendarView, canSelectDate date: Date) -> Bool {
return false
}
func calendar(_ calendar: CalendarView, didLongPressDate date: Date, withEvents events: [CalendarEvent]?) {
}
xcode:11.5 swift:5