hons82/THCalendarDatePicker

Current Date not colored

cytryn opened this issue · 3 comments

Current date only gets colored after I selecting the current date and then changing...

Sorry, I don't understand that...
Could you explain that a bit better... or add a screenshot of what you mean

thx

On the example project, current date was supposed to be red.

But it only turns red if I select the current date and then selecting another date.

Open the example, select todays date and then select another one, you will see

It's changing to white when the selected date is the current date.
In THDateDay that's the piece of code doing that

    if (self.currentDateColor && [self isToday]) {
        [self.dateButton setTitleColor:self.currentDateColor forState:UIControlStateNormal];
    }

Actually you'd just need to change it to this to have the behaviour you want

    if (self.currentDateColor && [self isToday]) {
        [self.dateButton setTitleColor:self.currentDateColor forState:UIControlStateSelected];
        [self.dateButton setTitleColor:self.currentDateColor forState:UIControlStateNormal];
    }

but this looks really disgusting, that's why I didn't put that in first place.