Open cancelself opened 4 years ago
@lananpurdy : I think we closed on this?
ok
https://github.com/richardtop/CalendarKit <- this one.
/ Return an array of EventDescriptors for particular date override func eventsForDate(_ date: Date) -> [EventDescriptor] { var models = // Get events (models) from the storage / API
var events = [Event]()
for model in models { // Create new EventView let event = Event() // Specify StartDate and EndDate event.startDate = model.startDate event.endDate = model.endDate // Add info: event title, subtitle, location to the array of Strings var info = [model.title, model.location] info.append("(datePeriod.beginning!.format(with: "HH:mm")) - (datePeriod.end!.format(with: "HH:mm"))") // Set "text" value of event by formatting all the information needed for display event.text = info.reduce("", {$0 + $1 + "\n"}) events.append(event) } return events }
https://github.com/benbahrenburg/awesome-calendars @lananpurdy