Permalink
Browse files

Merge pull request #9 from hlu/master

Name/Month titles
  • Loading branch information...
2 parents 89397f9 + d51f060 commit 41ea62eadf9c7091af4a78320705e1b54da379c7 @ocrickard committed Apr 12, 2012
Showing with 8 additions and 7 deletions.
  1. +8 −7 OCCalendarView/OCCalendarView.m
@@ -224,9 +224,12 @@ - (NSDate *)getEndDate {
}
- (void)drawRect:(CGRect)rect
-{
- NSArray *dayTitles = [NSArray arrayWithObjects:@"sun", @"mon", @"tu", @"wed", @"thu", @"fri", @"sat", nil];
-
+{
+ //// Get day titles from current Locale
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+ NSArray *dayTitles = [dateFormatter shortStandaloneWeekdaySymbols];
+ NSArray *monthTitles = [dateFormatter standaloneMonthSymbols];
+
//// General Declarations
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = UIGraphicsGetCurrentContext();
@@ -402,10 +405,8 @@ - (void)drawRect:(CGRect)rect
int month = currentMonth;
int year = currentYear;
- char *months[12] = {"January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"};
- NSString *monthTitle = [NSString stringWithFormat:@"%s %d", months[month - 1], year];
-
+
+ NSString *monthTitle = [NSString stringWithFormat:@"%@ %d", [monthTitles objectAtIndex:(month - 1)], year];
//// Month Header Drawing
CGContextSaveGState(context);

0 comments on commit 41ea62e

Please sign in to comment.