shoheiyokoyama / Koyomi

Simple customizable calendar component in Swift :calendar:
MIT License
749 stars 103 forks source link

multiple colors #45

Open thom5409 opened 6 years ago

thom5409 commented 6 years ago

Does there happen to be a way to color days different colors? Like if I want one day red and another day green? For example the code

let sevenDaysFromNow = Calendar.current.date(byAdding: .day, value: 7, to: Date())
calendarView.setDayBackgrondColor(.green, of: sevenDaysFromNow!)

let eightDaysFromNow = Calendar.current.date(byAdding: .day, value: 8, to: Date())
calendarView.setDayBackgrondColor(.red, of: eightDaysFromNow!)

Produces the following display two_red

sadhu-sanjay commented 6 years ago

Can anyone please Solve this problem, i need this feature very badly.

loverde-co commented 5 years ago

Me too!

kholidahnastain commented 5 years ago

I need this feature too , please help

kholidahnastain commented 5 years ago

I resolve this issue with add all component in setdaycolor in the pod

example : @discardableResult public func setDayColor(_ dayColor: UIColor, of date: Date, to toDate: Date? = nil) -> Self { model.setHighlightedDates(from: date, to: toDate) highlightedDayColor = dayColor return self }

@discardableResult
public func setDayColor1(_ dayColor1: UIColor, of date: Date, to toDate: Date? = nil) -> Self {
    model.setHighlightedDates1(from: date, to: toDate)
    highlightedDayColor1 = dayColor1
    return self
}