Giter Site home page Giter Site logo

richardtop / calendarkit Goto Github PK

View Code? Open in Web Editor NEW
2.4K 47.0 323.0 731 KB

๐Ÿ“… Calendar for Apple platforms in Swift

Home Page: https://www.youtube.com/watch?v=cJ63-_z1qg8

License: MIT License

Ruby 0.54% Swift 99.46%
cocoapods swift ios calendar ios-ui ios-calendar ios-lib ios-swift calendarkit swift-package-manager

calendarkit's People

Contributors

bithavoc avatar cstlex avatar danlozano avatar farshadtx avatar glaphi avatar grosch avatar inahuelzapata avatar jameswwwebster avatar jaytrisw avatar jdtzmn avatar jmorliaguet avatar joeljfischer avatar jpauljm avatar keith-nativemobile avatar kevalvadoliya avatar lilpit avatar linniergames avatar mihai-moldovan avatar mochathecoder avatar mojtabahs avatar orihpt avatar rarescrap avatar rich86man avatar richardtop avatar spiccinocchi avatar tgymnich avatar tomaculum avatar v-ken avatar vadymmarkov avatar zenangst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendarkit's Issues

Week(Month) View

It would be nice to have the opportunity to choose between a day/week( and possible month) view to have a better overview of all events.

How to usage

Is there any video about how to usage and how to setup this?

Inconsistency with events displaying.

Select the last date on header which doesnot have a event in his timeline. Now go to next week by scrolling week header you will see that the date on week header is selected last but the events are displaying for the next day. Also i can see same events for many days in week.

Dates in the header and timeline are not synchronized

On first load screen appear on next day, but if i scroll back it scrolls two days back, i.e. appear on 27 but if i scroll back will set on 25 (which is right if today is day back from day that appear), so problem in appearance i guess

Adjust font sizes and label width when based on view bounds

The font sizes and label sizes assume a large enough width for DayView. With a smaller view, labels start to overlap. Should additional params like DaySelectorStyle.dateLabelWidth and SwipeLabelStyle.labelFont be added to styles. The alternative would be to automatically size the element proportionally.

Calendar view does not update when deleteing the last event view

I have implemented a feature to delete a event by long pressing a event view.
Basically, the deletion works perfectly when there are more than 1 event in the data array.
However, when I delete the last event, the calendar view does not update immediately and the deleted view just stay there. I need to swipe to next week and come back to that day. Then, deleted event will then be disappeared.

I tried to reload the view after the deletion using the following functions, but none of it works.

self.reloadInputViews()
self.reloadData()
self.dayView.reloadData()
self.dayView.reloadInputViews()

I am not sure if it is a bug. Do you have a example code on how to delete a event properly?

Implement NSCopying for CalendarStyle

Implementing NSCopying for CalendarStyle will make it easier to apply adjustments to the style and less prone to errors if current style is changed without invocation of updateStyle method.

EventView

Realized that whenever a user clicks on an EventView I get the actual EventView back in the delegate method, BUT I have no way of knowing which actual Event (my own custom Model) they clicked.

I realize I could do some complicated logic by checking the Dates and trying to figure out which Event they actually clicked.

I "fixed" it locally by adding a var extraData: Any? property to EventView, then casting it back to my own model in the delegate.

Was thinking of a more elegant way to fix this since I think this could be a common issue.

The other way could be subclassing EventView, adding extra properties & logic, then casting the EventView back to my own subclass afterwards in the delegate method.

But for some reason I could not accomplish that. Something to do with the required initializer to be able to subclass EventView.

Would love to discuss an elegant approach to this.

Thanks for the great framework!

reloadData issue

I guess reloadData of DayViewController runs on the main thread causing UI to freeze. Can you please look into it. Why does the UI hang on reloadData.

How to scroll to the first event

Your git comment suggested that there is a way to scroll to the first event on a day. The function scrollToFirstEvent is present but it is not clear how I can access it. Please suggest how I can handle this. Or even scroll to a specific time such as 8:00 am when I display a day view.

Are there any other examples on how to use this very useful library to implement other functions such as displaying by week or month or making an entry in a time slot.

Got Swift Compiler Error in CalendarKit

I have followed the installation guide, but still failed to integrate your library to my existing project.
I retried a few time, but still getting the same errors like this:
a

I noticed that recently DateTools have released the latest swift update.
It changed from pod 'DateTools' to 'pod 'DateToolsSwift'`
Not sure if it is a issue...
I would be graceful if you could help me to solve this. Thanks.

pod error

[!] Unable to find a specification for CalendarKit
help me for this

user swipe events

Hi,
Is there a way to know what dates are being shown? user swipe callbacks?

Pinch to zoom gesture

@fanstudiouk

"Another thing that I believe it's missing or would be nice to have: when we have appointments of 10-15 minutes the height is too small and you can't see the content. It would be nice to be able to zoom-in our and adjust the timeline view height."

Same name as MBCalendarKit

Hey,

This looks like a great library!

I made a similar library with a very similar name a few years ago. If/when I Port to Swift, I'd want to drop the prefix, and as it stands this becomes a conflict.

Any chance you would consider renaming (or at least prefixing) this one?

Thanks!

Restrict hours set

Hi @richardtop !

I want to restrict the hours set presented in the calendar. For example, I want the lateral content(the hours) to be from 12:00 to 18:00.

There is currently any solution to this?

Vertical scroll [enhancement]

Hi Richards,

Thanks for sharing the CalendarKit! It's the best pod I've found so far.

What I would suggest is to be able to enable a vertical scroll in order to get to the next day. Currently we are restricted to the horizontal one.

Looking forward to see a detailed documentation of this amazing pod.

Also, if you're interested in implementing some custom features please let me know.

Cheers,
Andrei

Crash when select a date of at least 1 week before the current selected date at Calendar

Hi Richard,
I found a bug when selecting a date of at least 1 week before the current selected date at Calendar (not every time), the system will crash. It is due to the following statement in DayHeaderView has possibility to return the currentWeekDayIndex as 7.
image

I can fix it by changing the statement as following.

currentWeekdayIndex = abs(daysInWeek + daysFrom % daysInWeek) % daysInWeek

This will change the 7 to 0. Hope this help.

Overlapping Events Not Being Detected

I've seen numerous instances of events not being properly detected as overlapping, which causes one event to draw atop another given than their x-offset is incorrectly calculated.

In TimelineView.recalculateEventLayout(), the currently-operated-on event is only checked for overlap with the array's most recently added event, not the previous events in the array that could potentially be overlaps.

Is this potentially related to issue #43 ?

Implementation without subclassing view controller

Hello,

My understanding is that the library expects to be used by creating a view controller that subclasses DayViewController, taking the entire screen bounds. Is there a way to just use DayView in a region of the screen, with my view controller implementing DayViewDelegate?

Thanks!

Open on a date weeks in the future

It's 13 May but I want to show the dayView for 23 September.

I've tried calling changeCurrentDate(to newDate: Date). My chosen date is displayed briefly and then display switches to 20 May.

Is there a way to start at a date other than today?

open event in own view controller

How to open event n own view controller?

There is no indexPath or something like this.

func dayViewDidSelectEventView(_ eventview: EventView)

I want to retrieve data from realm data base in new view controller for selected Item.

Enhancement Request: Min Date and Max Date

It would be good to add support for a minimum and maximum date so that the pager wouldn't scroll past these values?

I may delve into the source code myself if I get the time. I envisage this as a single additional function added to the DayViewDelegate for open func dayView(dayView: DayView, canMoveTo date: Date). Are there any pitfalls I should be aware of if I was to approach it like this, please?

Crash when selecting year in the future 2020

Xcode Version 8.3 (8E162)

When running the example with pod try CalendarKit I found that the calendar crashes with fatal error: Index out of range when you select any year in the future.

See at DayHeaderView.scrollviewDidScrollToViewAtIndex
screen shot 2017-07-04 at 5 58 00 pm

Request: Details View next to Timline

It would be nice to have a customizable details view next to the timeline view. For now i just cant get it working. I tried the following in the DayView's layoutSubviews:

self.dayViewHeader.anchorAndFillEdge(.top, xPad: 0, yPad: 0, otherSize: self.dayViewHeaderHeight);
// self.timelinePager.alignAndFill(align: .underMatchingLeft, relativeTo: self.dayViewHeader, padding: 0);
        
self.timelinePager.alignAndFillHeight(align: .underMatchingLeft, relativeTo: self.dayViewHeader, padding: 0, width: ((self.frame.width / 3) * 2));
self.dayViewDetails.alignAndFillHeight(align: .underMatchingRight, relativeTo: self.dayViewHeader, padding: 0, width: (self.frame.width / 3));

But this is really messing up everything :D

Crash when move(to:) is called

Hi @richardtop
Thanks for creating CalendarKit, it has saved several hours of our development effort.

We have a requirement to navigate to next week on tap of a button, using move(to:) we are able to do this, however, strangely we encounter a crash only when we select the first day of the week and then move to previous week. For all other scenarios it works fine.

The way we are doing is,

    func moveDayView(withTimeChunk time : TimeInterval,from currentDate : Date) {
        let dateAfterSwipe = currentDate.addingTimeInterval(time)
        dayView.state = DayViewState(date: currentDate)
        dayView.state?.move(to: dateAfterSwipe)
        dayView(dayView: dayView, willMoveTo: dateAfterSwipe)
    }

I have attached screenshot where it crashes soon after the move happens
movetocrash

Change event view text colour

Hi!

Recently I started to use this library and now I need to change the label colour of all events and I can't do this. I don't know if I'm doing something wrong or what, but I can't do it.

I think this is a good aspect to think about...

All-day tasks

Hi!
Refer to apple calendar app, we need place to show all-day tasks at the bottom of timeline.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.