JoeCiou / JKCalendar

Calendar library for iOS
MIT License
90 stars 17 forks source link

Mark array of dates #31

Open ucelme opened 3 years ago

ucelme commented 3 years ago

Hello. I want to pass to calendar array of dates which should be checked. I try to use loop inside

func calendar(_ calendar: JKCalendar, marksWith month: JKMonth) -> [JKCalendarMark]? {

    for item in habbit.dates {
        print(item)

        let today = JKDay(date: item)
        if today == month {
            return [JKCalendarMark(type: .circle, day: today, color: .systemGreen)]
        }
    }
    return nil

}

but it doesn't work.