Update README and Example
This commit is contained in:
parent
27bec3f80f
commit
d52588f759
|
|
@ -34,6 +34,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarMonthPosition);
|
|||
- (NSIndexPath *)indexPathForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position;
|
||||
- (NSIndexPath *)indexPathForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position scope:(FSCalendarScope)scope;
|
||||
|
||||
- (NSDate *)pageForSection:(NSInteger)section;
|
||||
- (NSDate *)weekForSection:(NSInteger)section;
|
||||
- (NSDate *)monthForSection:(NSInteger)section;
|
||||
- (NSDate *)monthHeadForSection:(NSInteger)section;
|
||||
|
|
|
|||
|
|
@ -193,6 +193,18 @@
|
|||
[self.rowNumbers removeAllObjects];
|
||||
}
|
||||
|
||||
- (NSDate *)pageForSection:(NSInteger)section
|
||||
{
|
||||
switch (self.calendar.scope) {
|
||||
case FSCalendarScopeWeek:
|
||||
return [self weekForSection:section];
|
||||
case FSCalendarScopeMonth:
|
||||
return [self monthForSection:section];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDate *)monthForSection:(NSInteger)section
|
||||
{
|
||||
NSNumber *key = @(section);
|
||||
|
|
@ -282,9 +294,9 @@
|
|||
|
||||
- (FSCalendarMonthPosition)monthPositionForIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSDate *month = [self monthForSection:indexPath.section];
|
||||
NSDate *page = [self pageForSection:indexPath.section];
|
||||
NSDate *date = [self dateForIndexPath:indexPath];
|
||||
NSComparisonResult comparison = [self.gregorian compareDate:date toDate:month toUnitGranularity:NSCalendarUnitMonth];
|
||||
NSComparisonResult comparison = [self.gregorian compareDate:date toDate:page toUnitGranularity:NSCalendarUnitMonth];
|
||||
switch (comparison) {
|
||||
case NSOrderedAscending:
|
||||
return FSCalendarMonthPositionPrevious;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||

|
||||
|
||||
## Fully DIV support
|
||||

|
||||

|
||||
|
||||
|
||||
## Working with AutoLayout and Orientation
|
||||
|
|
@ -36,9 +36,6 @@
|
|||
## Hide placeholder dates
|
||||

|
||||
|
||||
## Scope gesture
|
||||

|
||||
|
||||
> FSCalendar doesn't change frame or the constraint by itself, see [Adjusts frame dynamicly](#adjusts_frame_dynamicly)
|
||||
|
||||
<br>
|
||||
|
|
|
|||
Loading…
Reference in New Issue