jonathantribouharet / JTCalendar

A customizable calendar view for iOS.
MIT License
2.76k stars 531 forks source link

Fix for automatic week count rendering and calculation #391

Closed mciarlo closed 3 years ago

mciarlo commented 3 years ago

I noticed certain number of weeks calculations were failing so I attempted a fix.

  1. I moved the JTDateHelper method numberOfWeeks: to use NSCalendarUnitWeekOfMonth instead.
  2. I added a call to setNeedsLayout in JTCalendarPageView to force the page to re-calculate the height of each week.

These two changes appear to resolve issues with the numberOfWeeksDisplayed set to 0