richardtop / CalendarKit

📅 Calendar for Apple platforms in Swift
https://www.youtube.com/watch?v=cJ63-_z1qg8
MIT License
2.52k stars 340 forks source link

Month View #308

Closed ShanbotCodePerson closed 1 year ago

ShanbotCodePerson commented 3 years ago

I needed a native-looking calendar to display both day views and month views. Calendar kit is perfect for day view but doesn't have an option to display the month view so I've created one. The regular DayViewController works as it did before. There is now a MonthViewController as well that does the same things but displays a month calendar view at the top instead of the bar of the days in the week. There is also a hybrid DayOrMonthViewController that can toggle seamlessly between the two headers when the function toggleDayMonthButtonTapped() is called.

richardtop commented 3 years ago

Hi, thanks for creating this pull request. First of all, it doesn't compile, could you please fix the compilation issues?

Overall, I think this can't go to the CK repository itself, as I try to keep it minimal, but this could be the case for CK derivative product/library. Is it possible for you to structure the code in a way that it will depend on CalendarKit and be a separate package? No need to do this right now, but we can discuss it after I'll be able to run your project.

justdan0227 commented 3 years ago

Has this been merged. Also need month view. Maybe I'm not understanding is CalendarKit just a DayView?

richardtop commented 3 years ago
  1. No, this hasn't been merged
  2. Yes, at this stage CK is just a DayView + it's components, so you can create your own version of the DayView. There are plenty of libraries which handle the Month / Year views.
justdan0227 commented 3 years ago

@richardtop can you suggest some that work with CalendarKit. Really love it but need a month view that reflects the event count on each day. Was thinking that CK would do this vs just showing the dayview (which is awesome)

richardtop commented 3 years ago

Pretty much any of the Month View libraries should work with CalendarKit, so it's better to evaluate yourself what would work for your codebase best. It's not a problem for CK to have a Month View, but it has to be: a) very flexible as DayView b) Integrate with DayView (e.g. have a simple way to configure both Day & Month views, have a similar API) c) Be of a very high caliber compared to what's on the market right now.

For example, this pull request, while good, is too specialized, so I think in the current shape it's best to have it as a separate package that depends on CalendarKit.

As for the month view suggestions, these might be of interest: https://github.com/airbnb/HorizonCalendar https://github.com/WenchaoD/FSCalendar