123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- //
- // LXCalendarMonthModel.m
- // LXCalendar
- //
- // Created by chenergou on 2017/11/2.
- // Copyright © 2017年 漫漫. All rights reserved.
- //
- #import "LXCalendarMonthModel.h"
- #import "NSDate+GFCalendar.h"
- @implementation LXCalendarMonthModel
- - (instancetype)initWithDate:(NSDate *)date {
-
- if (self = [super init]) {
-
- _monthDate = date;
-
- _totalDays = [self setupTotalDays];
- _firstWeekday = [self setupFirstWeekday];
- _year = [self setupYear];
- _month = [self setupMonth];
-
- }
-
- return self;
-
- }
- - (NSInteger)setupTotalDays {
- return [_monthDate totalDaysInMonth];
- }
- - (NSInteger)setupFirstWeekday {
- return [_monthDate firstWeekDayInMonth];
- }
- - (NSInteger)setupYear {
- return [_monthDate dateYear];
- }
- - (NSInteger)setupMonth {
- return [_monthDate dateMonth];
- }
- @end
|