Adding new calendars to iOS
iOS provides a set of calendars, that can be used in an application.
Here's the list of their ids:
NSString * const NSGregorianCalendar;
NSString * const NSBuddhistCalendar;
NSString * const NSChineseCalendar;
NSString * const NSHebrewCalendar;
NSString * const NSIslamicCalendar;
NSString * const NSIslamicCivilCalendar;
NSString * const NSJapaneseCalendar;
NSString * const NSRepublicOfChinaCalendar;
NSString * const NSPersianCalendar;
NSString * const NSIndianCalendar;
NSString * const NSISO8601Calendar;
What if I want to add more calendars. Let's say French Republican one
(http://en.m.wikipedia.org/wiki/French_Republican_Calendar)?
I perfectly understand that I can use formula to convert dates, but is
there a way to create own calendar to use just like the standard one, for
example:
NSDateFormatter *formatter = [NSDateFormatter new];
formatter.calendar = [[NSCalendar alloc]
initWithCalendarIdentifier:@"french_republican"]];
No comments:
Post a Comment