Skip to content

Commit

Permalink
Merge pull request #6 from jerrodputman/develop
Browse files Browse the repository at this point in the history
Fixed content offset when shifting dates
  • Loading branch information
evadne committed Mar 2, 2014
2 parents ef4ef8d + 5fff99a commit 38bf085
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DayFlow/DFDatePickerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ - (void) shiftDatesByComponents:(NSDateComponents *)components {
NSIndexPath *fromIndexPath = [cv indexPathForCell:((UICollectionViewCell *)visibleCells[0]) ];
NSInteger fromSection = fromIndexPath.section;
NSDate *fromSectionOfDate = [self dateForFirstDayInSection:fromSection];
CGPoint fromSectionOrigin = [self convertPoint:[cvLayout layoutAttributesForItemAtIndexPath:fromIndexPath].frame.origin fromView:cv];
UICollectionViewLayoutAttributes *fromAttrs = [cvLayout layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:fromSection]];
CGPoint fromSectionOrigin = [self convertPoint:fromAttrs.frame.origin fromView:cv];

_fromDate = [self pickerDateFromDate:[self.calendar dateByAddingComponents:components toDate:[self dateFromPickerDate:self.fromDate] options:0]];
_toDate = [self pickerDateFromDate:[self.calendar dateByAddingComponents:components toDate:[self dateFromPickerDate:self.toDate] options:0]];
Expand Down

0 comments on commit 38bf085

Please sign in to comment.