Skip to content

Commit

Permalink
Add useVeryShortWeekdaySymbols property for show day of week name ver…
Browse files Browse the repository at this point in the history
…y short
  • Loading branch information
Husseinhj committed Nov 7, 2017
1 parent 48ef7ed commit 5a60627
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ios_calendar/Sources/CalendarView.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ typedef NS_ENUM(NSInteger, CalendarEvent)
// Weekday indices start with Sunday = 0
// to match the indices provided by the NSDateFormatter method shortWeekdaySymbols
@property (nonatomic) NSInteger preferredWeekStartIndex;
@property (nonatomic) BOOL useVeryShortWeekdaySymbols;
@end
5 changes: 4 additions & 1 deletion ios_calendar/Sources/CalendarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,10 @@ - (void)drawWeekDays
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = self.locale;
NSArray *weekdayNames = [dateFormatter shortWeekdaySymbols];

if (_useVeryShortWeekdaySymbols) {
weekdayNames = [dateFormatter veryShortWeekdaySymbols];
}

if (self.calendarIdentifier == NSCalendarIdentifierPersian){
NSMutableArray *arrayWeeks = [weekdayNames mutableCopy];
[arrayWeeks insertObject:arrayWeeks.lastObject atIndex:0];
Expand Down

0 comments on commit 5a60627

Please sign in to comment.