All you need to do is pass an array of NSDate
s to the markDates:
method. You don't need to convert to Gregorian first as an NSDate
is simply a time stamp and is independent of calendars, time zones, and so forth.
I downloaded the VURIG Calendar sample project and in VRGViewController
replaced the calendarView:switchedToMonth:targetHeight:animated:
method with the following, which should illustrate exactly what you need:
-(void)calendarView:(VRGCalendarView *)calendarView switchedToMonth:(int)month targetHeight:(float)targetHeight animated:(BOOL)animated {
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];
NSDateComponents *components = [[NSDateComponents alloc] init];
[components setDay:6];
[components setMonth:10];
[components setYear:1434];
NSDate *date1 = [calendar dateFromComponents:components];
[components setDay:10];
NSDate *date2 = [calendar dateFromComponents:components];
[calendarView markDates:@[date1,date2]];
}
This marked Aug 12 and Aug 16 on the calendar, and while I'm not familiar with the Hijri calendar from what I can tell that's accurate.