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

Customize the month and day names to capitalize them?

3 Answers 52 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.
Jason Morris
Top achievements
Rank 1
Jason Morris asked on 20 Jan 2015, 11:23 PM
The default calendar has "january 2015" and "mon, tue, wed". How do I customize to show "January 2015" and "Mon, Tue, Wed,.."?

Thanks
Jason

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 21 Jan 2015, 09:24 AM
Hello Jason,

Thank you for your interest in our components.

You can do this by adopting the TKCalendarDelegate protocol and implementing its calendar:updateVisualsForCell: method. Consider the sample below;
- (void)calendar:(TKCalendar *)calendar updateVisualsForCell:(TKCalendarCell *)cell
{
    cell.label.text = [cell.label.text capitalizedString];
}

Do not forget to set the delegate property of TKCalendar:
self.calendarView.delegate = self;

Do not hesitate to contact us if you have other questions.

Regards,
Jack
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.

 
0
planer
Top achievements
Rank 1
answered on 02 Feb 2015, 06:06 PM
Thank you Jack.

I had the same question and happy to solved it that easy.

But how can I change the font of the cell?

cell.label.font = [UIFont defaultFontWithSize:14]
doesn't change the font, as well as changing the UILabel appearance
[[UILabel appearanceWhenContainedIn:[TKCalendarDayCell class], nil] setFont:[UIFont defaultFontWithSize:14]];
 
0
Jack
Telerik team
answered on 04 Feb 2015, 05:20 PM
Hi Tim,

In this case you should use the style property of TKCalendarDayCell. Here is an example:
- (void)calendar:(TKCalendar *)calendar updateVisualsForCell:(TKCalendarCell *)cell
{
    if ([cell isKindOfClass:[TKCalendarDayCell class]]) {
        cell.style.textFont = [UIFont systemFontOfSize:10];
    }
}

I hope this helps.

Regards,
Jack
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
Jason Morris
Top achievements
Rank 1
Answers by
Jack
Telerik team
planer
Top achievements
Rank 1
Share this question
or