Open SpencerMichaels opened 8 years ago
Just put something like this in your delegate:
- (void)calendar:(JTCalendarManager *)calendar prepareMenuItemView:(UIView *)menuItemView date:(NSDate *)date
{
NSString *text = nil;
if(date){
NSCalendar *the_calendar = calendar.dateHelper.calendar;
NSDateComponents *comps = [the_calendar components:NSCalendarUnitYear|NSCalendarUnitMonth fromDate:date];
NSInteger currentMonthIndex = comps.month;
static NSDateFormatter *dateFormatter = nil;
if(!dateFormatter){
dateFormatter = [calendar.dateHelper createDateFormatter];
}
dateFormatter.timeZone = calendar.dateHelper.calendar.timeZone;
dateFormatter.locale = calendar.dateHelper.calendar.locale;
while(currentMonthIndex <= 0){
currentMonthIndex += 12;
}
text = [[NSString alloc] initWithFormat:@"%@ %ld",[[dateFormatter standaloneMonthSymbols][currentMonthIndex - 1] capitalizedString], (long)comps.year];
}
[(UILabel *)menuItemView setText:text];
}
Does this still work for swift?
@CaptainKurt I just wound up using a swift calendar version -> https://cocoapods.org/pods/JTAppleCalendar
I would like to have a calendar where the top bar displays the year as well as the month. Some time ago there seems to have been a way to do this, but I cannot find anything in the documentation or in
JTCalendarMenuView.m
that seems to relate to changing the display format now, at least without changing line59
inJTCalendarDelegateManager.m
:Would it be possible to expose a method to change the format programmatically?