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

How to mark with dot or supplementaryView past/future month events? dayView is nil #100

Open
olesya0 opened this issue Jul 27, 2015 · 2 comments

Comments

@olesya0
Copy link

olesya0 commented Jul 27, 2015

Hello,
Is there any special actions to mark events in previous month?

for example I need to highlight any day in previous month with supplementaryView I try to do it like:

   func supplementaryView(shouldDisplayOnDayView dayView: DayView) -> Bool
   {
       let calender = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)
       var dif = calender!.compareDate(dayView.date.date, toDate: getDateDaysBefore(32), toUnitGranularity: NSCalendarUnit.DayCalendarUnit)
       if (dif == NSComparisonResult.OrderedSame)
       //if (dayView.date.day == 20 && dayView.date.month == 6)
       {
          return true
       }
       return false
    }

   func getDateDaysBefore(daysFromToday:Int) -> NSDate
    {
       let today = NSDate()
       let tomorrow = NSCalendar.currentCalendar().dateByAddingUnit(
       .CalendarUnitDay,
       value: -daysFromToday,
       toDate: today,
       options: NSCalendarOptions(0))
       return tomorrow!
    }

but when I scroll to previous month I got fatal error - dayView.date.date in dif is nil, dayView.date is nil, even I use commented line instead 2 lines with dif
(yes I open from private date in CVDate)

How to mark special dates in not represented month?

@pabloruan0710
Copy link

do you have work code? i m with same problem!! :( i'm help?

@mozharovsky
Copy link
Member

@olesya0, @pabloruan0710: We've included such an option in v2.0.0 task list. It will be live in a matter of weeks. Sorry for so late reply.

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

No branches or pull requests

3 participants