This is a migrated thread and some comments may be shown as answers.

Visible date range in week mode

1 Answer 44 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yehuda
Top achievements
Rank 1
Yehuda asked on 28 Jan 2015, 12:00 PM
How can I get the visible date range of the calendar when viewMode = TKCalendarViewModeWeek?

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 28 Jan 2015, 12:32 PM
Hi ,

If I understand the question right - you need to be able to request some data for each TKDayNameCell in TKCalendarViewModeWeek mode.

The recommended way of handling this is to use the following delegate method ( from TKCalendarDelegate  protocol):
 

- (void)calendar:(TKCalendar*)calendar updateVisualsForCell:(TKCalendarCell*)cell;
{
    if ([cell isKindOfClass:[TKCalendarDayNameCell class]]) {
       //provide and set data for the cell here ...
    }
}


This method will be invoked for each visible cell in a given moment. You can either enumerate cells here to get an array with all visible cells , or even better - set the data directly inside the method ( no need to get an array with the visible cells) .

In case you would like to prepare your data in advance ( even before rendering the view) , you will need to implement it with some custom code using the native NSCalendar API . TKCalendar does not expose a specific API to tell which days are in a given week. ( this is expected to  be a trivial task using NSCalendar).

Let me know if  you need further assistance on that.

Regards,
Pavel Pavlov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Calendar
Asked by
Yehuda
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or