Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added capitalized enum formats for weekday view; #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion JTCalendar/JTCalendarSettings.h
Expand Up @@ -10,7 +10,9 @@
typedef NS_ENUM(NSInteger, JTCalendarWeekDayFormat) {
JTCalendarWeekDayFormatSingle,
JTCalendarWeekDayFormatShort,
JTCalendarWeekDayFormatFull
JTCalendarWeekDayFormatFull,
JTCalendarWeekDayFormatShortCapitalized,
JTCalendarWeekDayFormatFullCapitalized
};

@interface JTCalendarSettings : NSObject
Expand Down
13 changes: 12 additions & 1 deletion JTCalendar/Views/JTCalendarWeekDayView.m
Expand Up @@ -69,16 +69,27 @@ - (void)reload
days = [[dateFormatter veryShortStandaloneWeekdaySymbols] mutableCopy];
break;
case JTCalendarWeekDayFormatShort:
case JTCalendarWeekDayFormatShortCapitalized:
days = [[dateFormatter shortStandaloneWeekdaySymbols] mutableCopy];
break;
case JTCalendarWeekDayFormatFull:
case JTCalendarWeekDayFormatFullCapitalized:
days = [[dateFormatter standaloneWeekdaySymbols] mutableCopy];
break;
}

for(NSInteger i = 0; i < days.count; ++i){
NSString *day = days[i];
[days replaceObjectAtIndex:i withObject:[day uppercaseString]];
switch(_manager.settings.weekDayFormat) {
case JTCalendarWeekDayFormatShortCapitalized:
case JTCalendarWeekDayFormatFullCapitalized:
day = [day capitalizedString];
break;
default:
day = [day uppercaseString];
}

[days replaceObjectAtIndex:i withObject:day];
}

// Redorder days for be conform to calendar
Expand Down