Fscalendar: Is there a way to set color of disabled day

Created on 1 Dec 2016  ·  2Comments  ·  Source: WenchaoD/FSCalendar

Is there a way to set color of disabled day

I have successfully set these dates to disabled, but the it still shows default black color

    func calendar(_ calendar: FSCalendar, shouldSelect date: Date) -> Bool {
        if enabledDays[date] == nil || enabledDays[date] == 0 {
            return false
        } else {
            return true
        }
    }

Most helpful comment

That's correct. 👍

All 2 comments

Hi,

You can implement the method titleDefaultColorFor from the FSCalendarDelegateAppearance delegate, using the same logic that you used to disable the dates. I think that should look something like this:

    func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, titleDefaultColorFor date: Date) -> UIColor? {
        if enabledDays[date] == nil || enabledDays[date] == 0 {
            return UIColor.disableColor
        } else {
            return UIColor.enabledColor
        }
    }

That's correct. 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TomWang1 picture TomWang1  ·  5Comments

StanleySathler picture StanleySathler  ·  5Comments

DaniloJrC picture DaniloJrC  ·  5Comments

thaoth58 picture thaoth58  ·  3Comments

KushThakkar picture KushThakkar  ·  6Comments