我已经使用 swift 包管理器在我的项目中添加了 CalendarKit,我也尝试过使用 cocoapods,但仍然出现以下错误:
我也添加import CalendarKit
了。
1) 'Date' 类型的值没有成员 'format'
let timezone = TimeZone.ReferenceType.default
var info:[String] = ["Booking Id: \(bookingDetails.bookingID ?? -1)", "Booking Type: \(bookingDetails.bookingType!)"]
info.append("Booking From : \(begining.format(with: "dd.MM.YYYY", timeZone: timezone)) \nBooking To : \(ending.format(with: "dd.MM.YYYY", timeZone: timezone))")
info.append("Timing: \(begining.format(with: "HH:mm")) - \(ending.format(with: "HH:mm"))")
info.append("Status: \(status)\n")
2)“日期”类型的值没有成员“小时”
if indexPath.section == 1 {
selectedbookingRecord = self.upcomingBookings![indexPath.row] as BookingInfoList
if let bookingStartDateTime = selectedbookingRecord?.bookingFrom {
if (bookingStartDateTime.toDate()?.hours(from: Date()))! < 24 {
DispatchQueue.main.async {
Alert().showAlert(ALERT_TITLE, message: GlobalConstants.CANNOT_DELETE_BOOKING, okButtonTitle: ALERT_OK_TITLE, CompletionHandler: nil, View: self)
}
return
}
}
}
提前致谢!