Skip to content

Commit

Permalink
implement getLastDayOfMonth method
Browse files Browse the repository at this point in the history
  • Loading branch information
Husseinhj committed Nov 21, 2017
1 parent 69de344 commit c9d10bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ios_calendar/Sources/CalendarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,14 @@ - (NSDate *) generateDateWithDay:(NSInteger) day month:(NSInteger) month year:(N

return [components.calendar dateFromComponents:components];
}

-(NSInteger) getLastDayOfMonth:(NSInteger) month year:(NSInteger) year{
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:self.calendarIdentifier];

NSDate *currentDate = [self generateDateWithDay:1 month:month year:year];
return [currentDate getLastDayOfMonthForCalendar:calendar];
}

#pragma mark - Generating of rects

- (void)generateDayRects
Expand Down

0 comments on commit c9d10bb

Please sign in to comment.