File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,17 @@ - (void)setCurrentDate:(NSDate *)date
223223 currentMonth = [components month ];
224224 currentYear = [components year ];
225225
226+ switch (type) {
227+ case CTDay:
228+ [self generateDayRects ];
229+ break ;
230+ case CTYear:
231+ [self generateYearRects ];
232+ break ;
233+ default :
234+ break ;
235+ }
236+
226237 _currentDate = date;
227238
228239 if (![_currentDate isEqualToDate: date]) {
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ - (NSUInteger)getLastDayOfMonth
2020
2121- (NSInteger )getWeekdayOfFirstDayOfMonth
2222{
23- NSTimeZone *timeZone = [NSTimeZone timeZoneWithAbbreviation: @" UTC " ];
24-
23+ NSTimeZone *timeZone = [NSTimeZone localTimeZone ];
24+
2525 NSCalendar *calendar = [[NSCalendar alloc ] initWithCalendarIdentifier: NSGregorianCalendar ];
2626 [calendar setTimeZone: timeZone];
2727 NSDateComponents *components = [calendar components: (NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit ) fromDate: self ];
Original file line number Diff line number Diff line change @@ -34,10 +34,17 @@ - (void)viewDidLoad
3434
3535 self.calendarView .calendarDelegate = self;
3636
37- // For testing setCurrentDate property
37+ // // For testing setCurrentDate property
3838// NSDate *d = [NSDate dateWithTimeIntervalSinceNow:-99656988];
3939// NSLog(@"%@", d);
4040// [self.calendarView setCurrentDate:d];
41+
42+ // NSDateComponents *comps = [[NSDateComponents alloc] init];
43+ // comps.year = 2015;
44+ // comps.month= 1;
45+ // comps.day = 1;
46+ // NSDate *toDate = [[NSCalendar currentCalendar] dateFromComponents:comps];
47+ // [self.calendarView setCurrentDate:toDate];
4148}
4249
4350- (void )didChangeCalendarDate : (NSDate *)date
You can’t perform that action at this time.
0 commit comments