Skip to content

Commit

Permalink
back todate debug
Browse files Browse the repository at this point in the history
  • Loading branch information
shevakuilin committed Apr 9, 2017
1 parent 3dec604 commit 80cc489
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Binary file not shown.
20 changes: 11 additions & 9 deletions SKCalendarView/SKCalendarView/View/SKCalendarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ - (SKCalendarManage *)calendarManage
// 设置初始化日期,默认查看今天所处月份日历
[_calendarManage checkThisMonthRecordFromToday:[NSDate date]];
self.theDate = [NSDate date];
self.monthBackgroundLabel.text = [NSString stringWithFormat:@"%@", @(_calendarManage.month)];
self.theDayInMonth = _calendarManage.todayInMonth;
self.theYear = _calendarManage.year;
[self reloadExternalDate];
}
Expand Down Expand Up @@ -277,20 +275,24 @@ - (void)setCheckNextMonth:(BOOL)checkNextMonth
- (void)checkCalendarWithAppointDate:(NSDate *)date
{
[self.calendarManage checkThisMonthRecordFromToday:date];
self.monthBackgroundLabel.text = [NSString stringWithFormat:@"%@", @(self.calendarManage.month)];
[self.calendarCollectionView reloadData];
self.theDate = date;
[self reloadExternalDate];
}

#pragma mark - 更新外部数据
- (void)reloadExternalDate
{
self.year = self.calendarManage.year;
self.month = self.calendarManage.month;
self.chineseYear = self.calendarManage.chineseYear;
self.chineseMonth = self.calendarManage.chineseMonth;
self.chineseCalendarDay = self.calendarManage.chineseCalendarDay;
self.chineseCalendarDate = self.calendarManage.chineseCalendarDate;
self.year = _calendarManage.year;
self.month = _calendarManage.month;
self.chineseYear = _calendarManage.chineseYear;
self.chineseMonth = _calendarManage.chineseMonth;
self.theDayInMonth = _calendarManage.todayInMonth;
self.chineseCalendarDay = _calendarManage.chineseCalendarDay;
self.chineseCalendarDate = _calendarManage.chineseCalendarDate;
self.monthBackgroundLabel.text = [NSString stringWithFormat:@"%@", @(_calendarManage.month)];
self.lastMonth = _calendarManage.month - 1;
self.nextMonth = _calendarManage.month + 1;
}

#pragma mark - 获取节日&节气
Expand Down
3 changes: 2 additions & 1 deletion SKCalendarView/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ - (void)clickBackToday
[self.calendarView checkCalendarWithAppointDate:[NSDate date]];
self.lastMonth = _calendarView.lastMonth;// 获取上个月的月份
self.nextMonth = _calendarView.nextMonth;// 获取下个月的月份

[self.lastButton setTitle:[NSString stringWithFormat:@"%@", @(self.lastMonth)] forState:UIControlStateNormal];
[self.nextButton setTitle:[NSString stringWithFormat:@"%@", @(self.nextMonth)] forState:UIControlStateNormal];
}

@end

0 comments on commit 80cc489

Please sign in to comment.