Skip to content
Browse files

Fixed incorrect month labels in payment calendar view

  • Loading branch information...
1 parent aabaa7c commit a077ba3dc735fb6a5fbf0844545339db08796c95 Ole Zorn committed Aug 11, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 Classes/YearView.m
View
3 Classes/YearView.m
@@ -60,6 +60,7 @@ - (void)drawRect:(CGRect)rect
[monthFormatter setDateFormat:@"MMMM"];
[monthFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSCalendar *calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
+ [calendar setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSDateComponents *currentDateComponents = [calendar components:NSYearCalendarUnit | NSMonthCalendarUnit fromDate:[NSDate date]];
NSInteger currentYear = [currentDateComponents year];
NSInteger currentMonth = [currentDateComponents month];
@@ -78,7 +79,7 @@ - (void)drawRect:(CGRect)rect
[[UIColor darkGrayColor] set];
}
NSDateComponents *monthComponents = [[[NSDateComponents alloc] init] autorelease];
- [monthComponents setMonth:i+1];
+ [monthComponents setMonth:i + 1];
NSDate *monthDate = [calendar dateFromComponents:monthComponents];
NSString *month = [monthFormatter stringFromDate:monthDate];

0 comments on commit a077ba3

Please sign in to comment.
Something went wrong with that request. Please try again.