Skip to content
This repository has been archived by the owner on Jun 23, 2019. It is now read-only.

Reset day background color method #54

Open
doruchidean opened this issue Jun 14, 2018 · 0 comments
Open

Reset day background color method #54

doruchidean opened this issue Jun 14, 2018 · 0 comments

Comments

@doruchidean
Copy link

Hi,

First of all, thank you for creating this library.

I am using setDayBackgrondColor(color, date) to highlight days with events, however, after editing an event, I need to update those days.

I tried using setDayBackgroundColor(color, of, to) to reset all the background to the default color, and then highlight only those ones with events. But for some reason, this method is highlighting all the days.

This is the method I'm using to reset all the backgrounds

func resetDaysBackgroundColor(month:Date) { let monthMargins = DateTimeUtils.getUnixMonthLimits(month) calendarView.setDayBackgrondColor(UIColor.white, of: Date(timeIntervalSince1970: monthMargins[0]), to: Date(timeIntervalSince1970: monthMargins[1])) } - which is making all the backgrounds YELLOW instead of WHITE

This is the method for highlighting the days with events
func onDaysWithEventsReady(data: [Date]) { let color = UIColor.init(named: "app_yellow")! for date in data { calendarView.setDayBackgrondColor(color, of: date) } }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant