patchthecode / JTAppleCalendar

The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable
https://patchthecode.com
MIT License
7.57k stars 812 forks source link

Hiding boundaries on single row layout #34

Closed krisanthony closed 8 years ago

krisanthony commented 8 years ago

Hey great work on this! Really smart and Apple-Esque implementation. I'm currently using the single row layout (numberOfRowsPerMonth = 1). Everything is working great, except that the boundary dates really do not make sense for this layout. You'll get a jump from (example May to June goes 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 29, 30, 31 and then back to 1 for June).

Is there a way to prevent these dates from showing, or a possibility to include this feature?

Also, is it possible to add the ability to set specific starting and ending dates for single row layout? Right now it will give the entire month it seems. So if I set the startDate as the beginning of this week and the end date today, it will give me all of May to July 9th, where I would like just this week (Sun to Sun).

Last question - currently scrollToDate scrolls to the beginning of the screen with 1 row layout. Is it possible to add the option to specify the scroll position? Perhaps let position: UICollectionViewScrollPosition = self.direction == .Horizontal ? .Left : .Top could reference a new parameter on scrollToDate?

miff commented 8 years ago

Same problem here simulator screen shot 01 06 2016 10 07 35

patchthecode commented 8 years ago

[Concerning the Boundarydates on single row selection] Yes, this is the final upgrade of the calendar I have to work on. I did not think about it because in my project because i do not use single rows. Upgrade is coming soon after i finish work on the other issues. I'm almost done with them.

patchthecode commented 8 years ago

Thinking on your other suggestions now

miff commented 8 years ago

Thank you 👍

miff commented 8 years ago

Just one more thing, this: _*\ Assertion failure in -[UICollectionViewData validateLayoutInRect:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitSim/UIKit-3512.60.7/UICollectionViewData.m:399

and this: *\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView received layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}'

get when you work with week calendar (one row). And that can only happen if start app in single row, if you first start with 6 rows and then open view with single row, everything is ok.

jtapplecalendar

patchthecode commented 8 years ago

@miff i've been doing many updates. Since the latest update, I do not see this issue occurring.

The latest update is on master branch. I have not released a version 3.0.2 for it yet. Any change you can test it to see if its still crashing for you?

Also @miff since this is a new issue, lets track it by creating a new issue, so the one here doesnt get confusing.

patchthecode commented 8 years ago

@krisanthony Ok. you have mentioned 3 suggestions, that should be tracked on 3 separate issues.

  1. It doesn't make sense to have boundaryDates with single row mode
  2. Add the ability to set specific starting and ending dates for single row layout? Right now it will give the entire month
  3. Scroll to date positioning.

Can you create these 3 and close this one? Thanks. I do not want to create them because I want because my username will be tracked as the issue creator. After creating the 3 new ones, then close this one.

krisanthony commented 8 years ago

Done!