Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Commit

Permalink
Added some missing cases to the calendar unit switch statement. Fixed…
Browse files Browse the repository at this point in the history
… issue 535.
  • Loading branch information
eskroch committed May 10, 2013
1 parent d6d05ea commit e51d44b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions framework/Source/CPTCalendarFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ -(NSString *)stringForObjectValue:(id)coordinateValue
dateComponents.month = componentIncrement;
break;

case NSWeekCalendarUnit:
dateComponents.week = componentIncrement;
break;

case NSDayCalendarUnit:
dateComponents.day = componentIncrement;
break;
Expand Down Expand Up @@ -235,6 +239,15 @@ -(NSString *)stringForObjectValue:(id)coordinateValue
[NSException raise:CPTException format:@"Unsupported calendar unit: NSYearForWeekOfYearCalendarUnit"];
}
break;
#endif
#if MAC_OS_X_VERSION_10_7 < MAC_OS_X_VERSION_MAX_ALLOWED || __IPHONE_4_0 < __IPHONE_OS_VERSION_MAX_ALLOWED
case NSCalendarCalendarUnit:
[NSException raise:CPTException format:@"Unsupported calendar unit: NSCalendarCalendarUnit"];
break;

case NSTimeZoneCalendarUnit:
[NSException raise:CPTException format:@"Unsupported calendar unit: NSTimeZoneCalendarUnit"];
break;
#endif
default:
break;
Expand Down

0 comments on commit e51d44b

Please sign in to comment.