Only in-range date should be selected or deselected

This commit is contained in:
Wenchao Ding 2016-11-27 21:55:32 +08:00
parent 99c4e8c025
commit ffff5938bd
1 changed files with 2 additions and 2 deletions

View File

@ -523,7 +523,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
return NO;
}
NSDate *date = [self.calculator dateForIndexPath:indexPath];
return [self.proxy shouldSelectDate:date atMonthPosition:monthPosition];
return [self isDateInRange:date] && [self.proxy shouldSelectDate:date atMonthPosition:monthPosition];
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
@ -557,7 +557,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
return NO;
}
NSDate *date = [self.calculator dateForIndexPath:indexPath];
return [self.proxy shouldDeselectDate:date atMonthPosition:monthPosition];
return [self isDateInRange:date] && [self.proxy shouldDeselectDate:date atMonthPosition:monthPosition];
}
- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath