Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to set color of disabled day #504

Closed
Mobiusor opened this issue Dec 1, 2016 · 2 comments
Closed

Is there a way to set color of disabled day #504

Mobiusor opened this issue Dec 1, 2016 · 2 comments

Comments

@Mobiusor
Copy link

Mobiusor commented Dec 1, 2016

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
        }
    }
@kallahir
Copy link
Contributor

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
        }
    }

@WenchaoD
Copy link
Owner

That's correct. 👍

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

No branches or pull requests

3 participants