10 #import "NSDate+CalendarView.h" 11 #import "NSString+CalendarView.h" 13 #import <CoreText/CoreText.h> 95 @property (nonatomic, strong) NSCalendarIdentifier calendarId;
96 @property (nonatomic, strong) NSLocale *calenderLocale;
108 - (void)drawCircle:(CGRect)rect toContext:(CGContextRef *)context withColor:(UIColor *)color;
109 - (void)drawRoundedRectangle:(CGRect)rect toContext:(CGContextRef *)context;
112 - (void)leftSwipe:(UISwipeGestureRecognizer *)recognizer;
113 - (void)rightSwipe:(UISwipeGestureRecognizer *)recognizer;
114 - (void)pinch:(UIPinchGestureRecognizer *)recognizer;
115 - (void)tap:(UITapGestureRecognizer *)recognizer;
116 - (void)doubleTap:(UITapGestureRecognizer *)recognizer;
120 - (void)advanceCalendarContentsWithEvent:(CalendarEvent)eventType;
121 - (void)rewindCalendarContentsWithEvent:(CalendarEvent)eventType;
123 - (NSDictionary *)generateAttributes:(NSString *)fontName withFontSize:(CGFloat)fontSize withColor:(UIColor *)color withAlignment:(NSTextAlignment)textAlignment;
124 - (BOOL)checkPoint:(CGPoint)point inArray:(NSMutableArray *)array andSetValue:(NSInteger *)value;
127 - (void) setCalendarIdentifier:(NSCalendarIdentifier)calendarIdentifier;
136 #pragma mark - Initialization 144 - (instancetype)initWithPosition:(CGFloat)x y:(CGFloat)y
154 - (instancetype)initWithFrame:(CGRect)frame
156 self = [
super initWithFrame:frame];
166 [
super awakeFromNib];
173 self.currentDate = nil;
174 self.fontColor = nil;
175 self.fontHeaderColor = nil;
176 self.fontSelectedColor = nil;
177 self.selectionColor = nil;
191 self.preferredWeekStartIndex = 1;
198 if (!_headerFontSize) {
203 [
self setMode:CalendarModeDefault];
206 self.fontColor = [UIColor blackColor];
207 self.fontHeaderColor = [UIColor redColor];
208 self.fontSelectedColor = [UIColor whiteColor];
209 self.selectionColor = [UIColor redColor];
210 self.todayColor = [UIColor redColor];
211 self.bgColor = [UIColor whiteColor];
212 self.backgroundColor = [UIColor clearColor];
214 self.shouldMarkSelectedDate = YES;
215 self.shouldMarkToday = NO;
216 self.shouldShowHeaders = NO;
218 UISwipeGestureRecognizer *left = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(leftSwipe:)];
219 [left setDirection:UISwipeGestureRecognizerDirectionLeft];
220 [
self addGestureRecognizer:left];
222 UISwipeGestureRecognizer *right = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(rightSwipe:)];
223 [right setDirection:UISwipeGestureRecognizerDirectionRight];
224 [
self addGestureRecognizer:right];
226 UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)];
227 [
self addGestureRecognizer:pinch];
229 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
230 tap.numberOfTapsRequired = 1;
231 [
self addGestureRecognizer:tap];
233 UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)];
234 doubleTap.numberOfTapsRequired = 2;
235 [
self addGestureRecognizer:doubleTap];
237 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self
238 action:@selector(longPress:)];
240 longPress.numberOfTouchesRequired = 1;
241 longPress.minimumPressDuration = 0.2f;
242 [
self addGestureRecognizer:longPress];
247 _dayRects = [[NSMutableArray alloc] init];
249 yearRects = [[NSMutableArray alloc] init];
254 event = CalendarEventNone;
256 NSDate *now = [NSDate date];
257 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];
258 NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:now];
267 - (void)setMode:(NSInteger)m
271 case CalendarModeDefault:
273 type = CalendarViewTypeDay;
277 case CalendarModeMonthsAndYears:
279 type = CalendarViewTypeMonth;
280 minType = CalendarViewTypeMonth;
283 case CalendarModeYears:
285 type = CalendarViewTypeYear;
286 minType = CalendarViewTypeYear;
295 #pragma mark - calendarIdentifier getter/setter methods 296 - (void) setCalendarIdentifier:(NSCalendarIdentifier)calendarIdentifier{
299 self.preferredWeekStartIndex = 0;
306 return NSCalendarIdentifierGregorian;
309 #pragma mark - locale getter/setter methods 310 - (void) setLocale:(NSLocale *)locale{
314 if (_calenderLocale) {
315 return _calenderLocale;
317 return [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
320 #pragma mark - reload 325 #pragma mark - Refresh 329 NSDate *now = [NSDate date];
341 #pragma mark - Getting, setting current date 343 - (void)setCurrentDate:(NSDate *)date
346 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];
347 NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:date];
353 case CalendarViewTypeDay:
360 case CalendarViewTypeYear:
375 return [
self generateDateWithDay:currentDay month:currentMonth year:currentYear];
385 NSDate *now = [NSDate date];
386 NSTimeZone *timeZone = [NSTimeZone timeZoneWithAbbreviation:@"America/Los Angeles"];
387 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];
388 [calendar setTimeZone:timeZone];
390 NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:now];
392 [components setCalendar:calendar];
393 [components setTimeZone:timeZone];
398 - (NSDate *) generateDateWithDay:(NSInteger) day month:(NSInteger) month year:(NSInteger) year{
401 [components setYear:year];
402 [components setMonth:month];
403 [components setDay:day];
404 [components setHour:0];
405 [components setMinute:0];
406 [components setSecond:0];
408 return [components.calendar dateFromComponents:components];
411 -(NSInteger) getLastDayOfMonth:(NSInteger) month year:(NSInteger) year{
412 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];
415 return [
currentDate getLastDayOfMonthForCalendar:calendar];
418 #pragma mark - Generating of rects 422 [_dayRects removeAllObjects];
424 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];
432 NSInteger weekday = [
currentDate getWeekdayOfFirstDayOfMonthForCalendar:calendar];
435 const CGFloat w =
self.dayCellWidth;
436 const CGFloat h =
self.dayCellHeight;
441 NSInteger xi = weekday -
self.preferredWeekStartIndex;
444 NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
445 formatter.locale =
self.locale;
447 for (NSInteger i = 1; i <= lastDayOfMonth; ++i) {
453 dayRect.
str = [formatter stringForObjectValue:@(i)];
454 dayRect.
frame = CGRectMake(x, y, w, h);
455 [_dayRects addObject:dayRect];
466 [_dayRects removeAllObjects];
468 NSDate *now = [NSDate date];
469 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];
470 NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:now];
471 [components setYear:currentYear];
472 [components setMonth:currentMonth];
473 [components setDay:1];
475 NSDate *
currentDate = [calendar dateFromComponents:components];
476 NSUInteger lastDayOfMonth = [
currentDate getLastDayOfMonthForCalendar:calendar];
478 NSInteger startDayOfMonth = [
currentDate getWeekdayOfFirstDayOfMonthForCalendar:calendar];
479 NSInteger plusRow = startDayOfMonth == 7?2:1;
480 if (startDayOfMonth >= 6 && lastDayOfMonth == 31) {
483 NSInteger weeks = (lastDayOfMonth / 7)+plusRow;
484 NSInteger minimumDayOfWeek = 1;
485 if (startDayOfMonth > 0) {
490 NSMutableArray *daysOfMonth = [[NSMutableArray alloc] init];
491 for (
int i = 1; i <= weeks; i++) {
492 NSMutableArray *arrayOfEachWeek = [[NSMutableArray alloc] init];
493 for (NSInteger j = startDayOfMonth; j >= minimumDayOfWeek ; j--) {
494 if (j > lastDayOfMonth) {
497 [arrayOfEachWeek addObject:@(j)];
499 [daysOfMonth addObject:arrayOfEachWeek];
502 if (startDayOfMonth > lastDayOfMonth) {
503 startDayOfMonth = startDayOfMonth - (startDayOfMonth - lastDayOfMonth);
507 [components setDay:currentDay];
508 currentDate = [calendar dateFromComponents:components];
509 NSInteger weekday = [
currentDate getWeekdayOfFirstDayOfMonthForCalendar:calendar];
510 weekday = weekday == 0 ? 1:weekday;
512 const CGFloat w =
self.dayCellWidth;
513 const CGFloat h =
self.dayCellHeight;
521 NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
522 formatter.locale =
self.locale;
524 for (
int i = 0; i < daysOfMonth.count; i++) {
525 NSArray *week = (NSArray *)daysOfMonth[i];
526 for (
int j = 0; j < week.count; j++) {
532 dayRect.
str = [formatter stringForObjectValue:@(day)];
533 dayRect.
frame = CGRectMake(x, y, w, h);
535 (i < daysOfMonth.count -1 && j == week.count -1)) {
538 [_dayRects addObject:dayRect];
552 NSDateFormatter *formater = [NSDateFormatter new];
553 formater.locale =
self.locale;
554 NSArray *monthNames = [formater standaloneMonthSymbols];
558 for (NSString *monthName in monthNames) {
559 x = xi *
self.monthCellWidth;
564 monthRect.
value = index;
565 monthRect.
str = monthName;
580 NSMutableArray *years = [[NSMutableArray alloc] init];
582 [years addObject:@(year)];
587 NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
588 formatter.locale =
self.locale;
590 for (NSNumber *obj in years) {
591 x = xi *
self.yearCellWidth;
595 yearRect.
value = [obj integerValue];
596 yearRect.
str = [formatter stringForObjectValue:@([obj integerValue])];
607 # pragma mark - Layout Calculations 643 #pragma mark - Drawing 645 - (void)drawRect:(CGRect)rect
647 CGContextRef context = UIGraphicsGetCurrentContext();
648 CGContextClearRect(context, rect);
650 CGContextSetFillColorWithColor(context,
self.
bgColor.CGColor);
651 CGContextFillRect(context, rect);
656 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentCenter)];
661 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentCenter)];
666 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentCenter)];
671 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentRight)];
676 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentLeft)];
678 CTFontRef cellFont = CTFontCreateWithName((__bridge CFStringRef)
self.
fontName,
self.
dayFontSize, NULL);
679 CGRect cellFontBoundingBox = CTFontGetBoundingBox(cellFont);
682 NSNumberFormatter *yearFormater = [[NSNumberFormatter alloc] init];
683 yearFormater.locale =
self.locale;
684 NSString *year = [yearFormater stringForObjectValue:@(currentYear)];
685 const CGFloat yearNameX = (
self.dayCellWidth - CGRectGetHeight(cellFontBoundingBox)) * 0.5;
691 [year drawUsingRect:yearTitleRect withAttributes:attributesRedLeft];
693 if (
mode != CalendarModeYears) {
694 NSDateFormatter *formater = [NSDateFormatter new];
695 formater.locale =
self.locale;
696 NSArray *monthNames = [formater standaloneMonthSymbols];
697 NSString *monthName = monthNames[(currentMonth - 1)];
704 [monthName drawUsingRect:monthTitleRect withAttributes:attributesRedRight];
707 NSMutableArray *rects = nil;
708 NSInteger currentValue = 0;
711 case CalendarViewTypeDay:
719 case CalendarViewTypeMonth:
725 case CalendarViewTypeYear:
738 NSDictionary *attrs = attributesBlack;
739 CGRect rectText = rect.frame;
740 rectText.origin.y = rectText.origin.y + ((CGRectGetHeight(rectText) - CGRectGetHeight(cellFontBoundingBox)) * 0.5);
743 if (
type == CalendarViewTypeDay) {
747 attrs = attributesWhite;
750 attrs = attributesWhite;
753 attrs = attributesWhite;
754 }
else if ((
startRangeDay == 0 && rect.value == currentValue &&
self.shouldMarkSelectedDate) ||
756 if (type == CalendarViewTypeDay) {
763 attrs = attributesWhite;
764 }
else if (type == CalendarViewTypeDay &&
768 self.shouldMarkToday) {
770 attrs = attributesWhite;
771 }
else if (type == CalendarViewTypeMonth) {
772 attrs = attributesBlack;
774 attrs = attributesBlack;
777 if (rect.isVecation && attrs != attributesWhite) {
778 attrs = attributesRed;
780 [rect.str drawUsingRect:rectText withAttributes:attrs];
795 - (void)drawCircle:(CGRect)rect toContext:(CGContextRef *)context withColor:(UIColor *)color
797 CGContextSetFillColorWithColor(*context, color.CGColor);
798 CGContextFillEllipseInRect(*context, rect);
801 - (void)drawRoundedRectangle:(CGRect)rect toContext:(CGContextRef *)context
803 CGContextSetFillColorWithColor(*context,
self.
selectionColor.CGColor);
805 CGFloat minx = CGRectGetMinX(rect), midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect);
806 CGFloat miny = CGRectGetMinY(rect), midy = CGRectGetMidY(rect), maxy = CGRectGetMaxY(rect);
808 CGContextMoveToPoint(*context, minx, midy);
813 CGContextClosePath(*context);
815 CGContextSetStrokeColorWithColor(*context,
self.
selectionColor.CGColor);
816 CGContextDrawPath(*context, kCGPathFillStroke);
821 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
822 dateFormatter.locale =
self.locale;
823 NSArray *weekdayNames = [dateFormatter shortWeekdaySymbols];
824 if (_useVeryShortWeekdaySymbols) {
825 weekdayNames = [dateFormatter veryShortWeekdaySymbols];
829 NSMutableArray *arrayWeeks = [weekdayNames mutableCopy];
830 [arrayWeeks insertObject:arrayWeeks.lastObject atIndex:0];
831 [arrayWeeks removeObjectAtIndex:arrayWeeks.count-1];
832 weekdayNames = [[arrayWeeks reverseObjectEnumerator] allObjects];
838 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentCenter)];
843 withAlignment:NSTextAlignmentFromCTTextAlignment(kCTTextAlignmentCenter)];
847 const CGFloat w =
self.dayCellWidth;
848 const CGFloat h =
self.dayCellHeight;
851 NSInteger adjustedIndex = i -
self.preferredWeekStartIndex;
853 NSString *str = [NSString stringWithFormat:@"%@", weekdayNames[i]];
855 [str drawUsingRect:CGRectMake(x, y, w, h) withAttributes:attrsForVecation];
857 [str drawUsingRect:CGRectMake(x, y, w, h) withAttributes:attrs];
861 for (NSInteger i = 0; i <
self.preferredWeekStartIndex; ++i) {
864 NSString *str = [NSString stringWithFormat:@"%@", weekdayNames[i]];
865 [str drawUsingRect:CGRectMake(x, y, w, h) withAttributes:attrs];
870 #pragma mark - Change date event 875 if (_calendarDelegate && [_calendarDelegate respondsToSelector:
@selector(didChangeCalendarDate:)]) {
876 [_calendarDelegate didChangeCalendarDate:currentDate];
878 if (_calendarDelegate && [_calendarDelegate respondsToSelector:
@selector(didChangeCalendarDate:withType:withEvent:)]) {
879 [_calendarDelegate didChangeCalendarDate:currentDate withType:type withEvent:event];
883 #pragma mark - Select range of calendar 886 if (_calendarDelegate && [_calendarDelegate respondsToSelector:
@selector(didSelectRangeForStartDate:andEndDate:)]) {
887 [_calendarDelegate didSelectRangeForStartDate:startDate andEndDate:endDate];
891 #pragma mark - Advance/Rewind Calendar Contents 903 - (void)advanceCalendarContentsWithEvent:(CalendarEvent)eventType
908 case CalendarViewTypeDay:
925 case CalendarViewTypeMonth:
930 case CalendarViewTypeYear:
945 - (void)rewindCalendarContentsWithEvent:(CalendarEvent)eventType
950 case CalendarViewTypeDay:
967 case CalendarViewTypeMonth:
972 case CalendarViewTypeYear:
987 #pragma mark - Gestures 989 - (void)leftSwipe:(UISwipeGestureRecognizer *)recognizer
994 - (void)rightSwipe:(UISwipeGestureRecognizer *)recognizer
999 - (void)pinch:(UIPinchGestureRecognizer *)recognizer
1001 if (recognizer.state == UIGestureRecognizerStateEnded) {
1003 if (recognizer.velocity < 0) {
1004 event = CalendarEventPinchIn;
1010 event = CalendarEventPinchOut;
1011 if (t + 1 < CalendarViewTypeCount) {
1023 - (void)tap:(UITapGestureRecognizer *)recognizer
1025 event = CalendarEventTap;
1026 CGPoint touchPoint = [recognizer locationInView:self];
1029 if (
type != CalendarViewTypeYear) {
1030 type = CalendarViewTypeYear;
1037 if (
type != CalendarViewTypeMonth) {
1038 type = CalendarViewTypeMonth;
1046 case CalendarViewTypeDay:
1051 case CalendarViewTypeMonth:
1056 case CalendarViewTypeYear:
1068 [
self setNeedsDisplay];
1072 - (void)doubleTap:(UITapGestureRecognizer *)recognizer
1074 event = CalendarEventDoubleTap;
1080 if (
type == CalendarViewTypeDay) {
1089 if (
event == CalendarEventDoubleTap && _calendarDelegate && [_calendarDelegate respondsToSelector:
@selector(didDoubleTapCalendar:withType:)]) {
1090 [_calendarDelegate didDoubleTapCalendar:currentDate withType:type];
1094 - (void) longPress:(UILongPressGestureRecognizer *) press{
1096 NSSet *key = [press valueForKey:@"activeTouches"];
1097 if (key.count == 0) {
1102 CGPoint touchPoint = [press locationInView:self];
1106 if (
type == CalendarViewTypeYear){
1122 }
else if (
type == CalendarViewTypeMonth) {
1139 }
else if (
type == CalendarViewTypeDay) {
1141 if (rectWasTapped) {
1142 day = rectWasTapped.
value;
1171 [
self setNeedsDisplay];
1173 #pragma mark - Additional functions 1175 - (BOOL)checkPoint:(CGPoint)point inArray:(NSMutableArray *)array andSetValue:(NSInteger *)value{
1180 *value = rect.
value;
1186 if (CGRectContainsPoint(rect.
frame, point)) {
1193 - (NSDictionary *)generateAttributes:(NSString *)fontName withFontSize:(CGFloat)fontSize withColor:(UIColor *)color withAlignment:(NSTextAlignment)textAlignment
1195 NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
1196 [paragraphStyle setAlignment:textAlignment];
1197 [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
1201 font = [UIFont systemFontOfSize:fontSize];
1203 font = [UIFont fontWithName:self.fontName size:fontSize];
1205 NSDictionary * attrs = @{
1206 NSFontAttributeName : font,
1207 NSForegroundColorAttributeName : color,
1208 NSParagraphStyleAttributeName : paragraphStyle
1216 [UIView animateWithDuration:kCalendarViewSwipeMonthFadeInTime
1222 completion:^(BOOL finished) {
1223 [
self setNeedsDisplay];
1224 [UIView animateWithDuration:kCalendarViewSwipeMonthFadeOutTime
BOOL checkPoint:inArray:andSetValue:(CGPoint point, [inArray] NSMutableArray *array, [andSetValue] NSInteger *value)
CGFloat getEffectiveMonthsYOffset()
void setMode:(NSInteger m)
CalendarViewRect * checkPoint:inArray:(CGPoint point, [inArray] NSMutableArray *array)
static const CGFloat kCalendarViewDayFontSize
void setCurrentDate:(NSDate *date)
static const CGFloat kCalendarViewYearLabelWidth
instancetype initWithPosition:y:(CGFloat x, [y] CGFloat y)
static const CGFloat kCalendarViewHeaderFontSize
void advanceCalendarContentsWithEvent:(CalendarEvent eventType)
void generateMonthRects()
CGFloat getEffectiveDaysYOffset()
CGFloat getEffectiveYearsYOffset()
static const NSTimeInterval kCalendarViewSwipeMonthFadeInTime
NSInteger preferredWeekStartIndex
CGFloat getEffectiveWeekDaysYOffset()
void selectRangeOfCalendar()
void drawCircle:toContext:withColor:(CGRect rect, [toContext] CGContextRef *context, [withColor] UIColor *color)
static const CGFloat kCalendarViewMonthTitleOffsetY
static const CGFloat kCalendarViewYearCellWidth
void advanceCalendarContents()
instancetype initWithFrame:(CGRect frame)
NSMutableArray * yearRects
static const CGFloat kCalendarViewWeekDaysYOffset
void generatePersianDayRects()
NSInteger startRangeMonth
static const CGFloat kCalendarViewMonthLabelWidth
NSDateComponents * generateDateComponents()
static const CGFloat kCalendarViewDayCellWidth
void rewindCalendarContentsWithEvent:(CalendarEvent eventType)
static const CGFloat kCalendarViewDayCellOffset
CalendarViewRect * startRangeDayRect
static const CGFloat kCalendarViewYearYStep
static const NSInteger kCalendarViewDaysInWeek
static const CGFloat kCalendarViewSelectionRound
NSDate * generateDateWithDay:month:year:(NSInteger day, [month] NSInteger month, [year] NSInteger year)
static const NSTimeInterval kCalendarViewSwipeMonthFadeOutTime
NSMutableArray * monthRects
static const CGFloat kCalendarViewDayCellHeight
CalendarViewRect * endRangeDayRect
static const CGFloat kCalendarViewDaysYOffset
void rewindCalendarContents()
static const CGFloat kCalendarViewMonthCellHeight
static const NSInteger kCalendarViewMonthInYear
static const NSInteger kCalendarViewYearsInLine
static const CGFloat kCalendarViewYearTitleOffsetY
void drawRoundedRectangle:toContext:(CGRect rect, [toContext] CGContextRef *context)
static const CGFloat kCalendarViewYearLabelHeight
NSDictionary * generateAttributes:withFontSize:withColor:withAlignment:(NSString *fontName, [withFontSize] CGFloat fontSize, [withColor] UIColor *color, [withAlignment] NSTextAlignment textAlignment)
static const CGFloat kCalendarViewYearCellHeight
static const NSInteger kCalendarViewYearsAround
static NSString *const kCalendarViewDefaultFont
static const NSInteger kCalendarViewMaxLinesCount
NSCalendarIdentifier calendarIdentifier
NSInteger getLastDayOfMonth:year:(NSInteger month, [year] NSInteger year)
static const CGFloat kCalendarViewMonthYStep
static const CGFloat kCalendarViewMonthLabelHeight
static const CGFloat kCalendarViewMonthCellWidth
static const NSInteger kCalendarViewMonthInLine