Calendar: Localization

By defualt, TKCalendar uses the current system locale and calendar settings. However, it allows for specifying those settings explicitly, overriding the system settings. This article describes how to do this.

The calendar property of TKCalendar specifies the NSCalendar to be used. You can use this property to change the first day in week to Monday for example:

NSCalendar calendar = new NSCalendar (NSCalendarType.Gregorian);
calendar.FirstWeekDay = 2;

Or, you can change the calendar with one specific for your users:

this.CalendarView.Calendar = new NSCalendar (NSCalendarType.Chinese);

Month names and week day names are provided by the locale property. Use the following code to customize the current locale:

this.CalendarView.Locale = new NSLocale ("ru_RU");

After modifying the locale you should call the update: method for the presenter:

((TKCalendarMonthPresenter)this.CalendarView.Presenter).Update (false);