jumartin / calendar Goto Github PK
View Code? Open in Web Editor NEWA set of views and controllers for displaying and scheduling events on iOS
License: MIT License
A set of views and controllers for displaying and scheduling events on iOS
License: MIT License
It'd be awesome to have a quick guide in the readme for fast and simple implementation rather than having to search through the example in an attempt to get just a quick simple implementation working!
I'm trying to refresh the view based on changes to the calendar data by another app. I'm hooking the event store like so:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(refreshCalendar:)
name:EKEventStoreChangedNotification
object:[self.calMgr getEventStore]];
The problem is, I'm not sure how to refresh the view. I've tried various things but there doesn't seem to be 1 call that I can use to refresh the view controllers REGARDLESS of the view type I'm using at this point (Week, Month, Year).
Is there a call that will reload the data and views?
This library looks great and I'd like to integrate it in my project.
I know I can download it manually, but do you have any plans for making it Carthage compatible?
Copy this url ,and open it in you chrome please!
http://card.weibo.com/article/h5/s#cid=230927749094095200190464&from=1066193010&wm=3333_2001&ip=124.161.202.134
Hello!Your calendar is great!I ;m trying to convert it to Swift and a'i m having some trouble there.Will a Swift compatible version be available anytime soon?Or where should i start??Thank you in advance!
hi , nice work
just asking how can i load event from json ?
and is there a specific structure to pass to the calendar.
or maybe just save event from ws to the calendar.
thx
I'm working on an app for older folks and love the calendar, but they can't see the words as the font is too small. I'm trying to figure out the best path for making the event cells larger so that I can adjust the font to a size they can more ably see. Would appreciate any pointers in the right direction....
how can fetch(reload) events from core data? where is the code to load events to show?
Hi I just want to use the month view. and don't want to show anything when click the cell.
How to disable it?
Thank you very much.
I am getting this error on device rotation when using single day display on iPhone.
'Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.'
I am not exactly sure how to fix it. I also got odd drawing artefacts on rotation animation - the displayed text in an eventView stretches out like it was written on silly-putty.
Also, the day column does not expand properly during animation (when going from portrait to landscape) so that it displays 2 columns instead of 1 column at the end of rotation.
Thanks so much for providing this great repo! I was wondering why I saw a difference between what was pulled into my project than what I saw in the repo, and noticed in my Podfile.lock that it downloaded 1.0, even though 2.0 is what is listed on cocoapods.org. I specified a specific commit, and that worked, but I don't like that as a long-term solution. Am I missing something?
Hi,
I am trying to use viewForEventOfType:
within my controller which extends from MGCDayPlannerViewController
. I only use MGCTimedEventType
s and they work fine as long as they don't overlap days. If they overlap, all next days plus same day appear as all-day, see attachment.
I do set the range with dateRangeForEventOfType:
, where I'm essentially returning [MGCDateRange dateRangeWithStart:event.beginDate end:event.endDate];
Last place I can imagine go wrong is the numberOfEventsOfType:
method. Currently I use an NSDictionary<NSString *, NSArray *>, where the key is the format string of the begin date of the event (so no knowledge of overlapping) and the value is the array of events starting at that day.
What does this method expect exactly? if I have only one event from 1 July 13:00 to 3 July 19:00; does it mean that:
1 July returns 1
2 July returns 1
3 July returns 1
?
Thanks a lot
Hello!
Our app is using your library, and you included a few additions recently (being able to set colors, restrict timeframe) which we really need before the release. I see that you are actively improving the library currently. When do you plan to release a new CocoaPod version which includes these changes? Shall I wait for it or just use a git source in my project?
I am trying to modify the calendar view for displaying time slots with minutes label in between each hours slot like
00 : 00 -------------------------------------------------
:15
:30
:45
01 : 00 -------------------------------------------------
Like this on pinch the time slot what should i do for above mentioned scenario ?
can any one help me in this stuff ?
Thanks in advance.
Hi,
I'm new to this but your library looks very promising.
In your demo app, long-press invokes what I'm assuming is the popup of the default event view. Can we override this to something else? For the sake of an example, how can one override this to an NSLog presenting the new date?
Thanks
I am developing calendar view control in swift. But it is not working with MGCDayPlannerEKViewController.
When i subclass my custom class with MGCDayPlannerEKViewController and with protocol WeekViewControllerDelegate as given in this example it give me error like
Property 'delegate' with type 'WeekViewControllerDelegate?' cannot override a property with type 'MGCDayPlannerEKViewControllerDelegate!' (aka 'ImplicitlyUnwrappedOptional<MGCDayPlannerEKViewControllerDelegate>')
Guys,, i need a swift version or a swift tutorial to use this calendar in my project since i am not an expert in objective C. Anyone have used this library in their swift project? if it is, i need help to implement this library in my project
is this fonctionnality possible :) thx
Hi,
Currently the demo app loads the calendar from the device itself, and I did not notice a method to change the data source on controller level. Is there a way to set our own events, for example by parsing a custom JSON array to an NSArray? (assuming the items comply to a specific structure)
Thanks for all this work.
Have any of you have had any kind of issue when uploading a build using CalendarLib in the App Store?
I keep getting this message
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an
**NSCalendarsUsageDescription**
key with a string value explaining to the user how the app uses this data.
I have already included the NSCalendarUsageDescription
in the Info.plist
and InfoPlist.strings
but the app keeps getting rejected. If nobody else have this issue and it has nothing to do with the library, you can please close this issue. But I have tried anything and I got to consider maybe the library had something to do.
Huge memory leaks and overhead CPU usage occurs when scrolling MGCMonthPlannerView. Not shure but looks like it's on MGCEventsRowView. Tried to change maxVisibleLinesForDaysInRange method like in the code below, but it solves a little part of this bug occurences
- (NSUInteger)maxVisibleLinesForDaysInRange:(NSRange)range
{
NSUInteger count = 0;
for (NSUInteger day = range.location; day < NSMaxRange(range); day++)
{
count = MAX(count, [self numberOfEventsForDayAtIndex:day]);
}
// if count > max, we have to keep one row to show "x more events"
return count > self.maxVisibleLines ? (self.maxVisibleLines == 0 ? 0 : self.maxVisibleLines - 1) : count;
}
I would like to change the separator lines' color via some property from [UIColor greyColor]
.
This is also true for the event indicator dots in the headers.
I would like to set some custom background color (for example light gray) for times outside a certain time range (like before 9 AM and after 6 PM, plus weekends). To be exact, we are using CalendarLib for displaying dentist's schedules. The doctors have a duty time, and I want to display this duty time by dimming their off-duty times slightly. They have different duty times for each day, so being able to dim ranges by individual days would be handy.
Hello,
I try to populate a week PlannerView from a web service.
I have a crash in checkIfValid
method. The assertion failed even if the dates I pass are in the right order. This is because the retained end date is actually the last end date I passed, whereas the retained start date is generated by the lib. Here's my log when I create the MGCDateRange :
period : 2016-10-12 12:00:00 +0000 - 2016-10-12 16:00:00 +0000
period : 2016-10-12 18:00:00 +0000 - 2016-10-12 20:00:00 +0000
period : 2016-10-09 07:00:00 +0000 - 2016-10-09 10:00:00 +0000
period : 2016-10-09 11:00:00 +0000 - 2016-10-09 12:00:00 +0000
period : 2016-10-12 12:00:00 +0000 - 2016-10-12 16:00:00 +0000
and the retained start / end dates when assertion failed :
_start : 2016-10-16 22:00:00 UTC
_end : 2016-10-12 16:00:00 UTC
I should precise that I restrict the visible days to 7, and I don't care of the real date. I just care of the weekday and time. The web service returnes me an Int for the weekday and a string for the time (HH:mm
), so I generate my own dates based on these values and the current date ('NSDate()').
The view is bounded by the current week's start and the current week's end.
Is there a workaround to do in my case ?
Thanks
Hello,
is there a designated way to change the backgroundcolor of a MGCDayColumnCell inside a MGCDayPlannerView?
Hi, this is a wonderful calendar!
I found one issue: If I´m in the weekView (I only show one day) and long tap on an event and drag it, the app crashes if only a small part of the event is visible (the main part of the event is hidden under the top).
The crash occurs in
of course startDate and endDate is nil
The problem comes from here:
(NSDate*)dateAtPoint:(CGPoint)point rounded:(BOOL)rounded
{
if (self.dayColumnsView.contentSize.width == 0) return nil;
CGPoint ptDayColumnsView = [self convertPoint:point toView:self.dayColumnsView];
ptDayColumnsView has a negative y value so the function returns nil
Hi Julien. First of all, thanks for your good work here, saved me lots of time.
I can't limit properly the starting hour of a MGCDayPlannerView. I want to limit the view so users can't scroll before 08.00 AM, for example. In my current app, really makes no sense that users plan activities between 00.00 and 08.00. I was trying to play with content offsets on scrolling views, with no luck. Can you kindly explain me (or, at least, orient me) about this matter?
Thanks in advance
i am trying to use your lib in my swift app while building. Have you already ported it in swift or have some example of calling from swift app.
Hello,
I subclassed :
class selectTime: MGCDayPlannerViewController,CalendarViewControllerDelegate,
WeekViewControllerDelegate{
and it crashes every time I open this controller because of unwrapping optional object
fatal error: unexpectedly found nil while unwrapping an Optional value
and I trace the error and I found the line that causes this error:
self.calendarViewController = controller
this is implemented in viewDidLoad, i'm using swift, and here is how I created controller
object:
let controller:CalendarViewController = controllerForView(type: .CalendarViewWeekType)
and how to implement didEndLongPress method
and if anybody has an example of this library written in swift, please share it with us ❤️
thanks
When you are in the week view of the app and select the today button twice the app will freeze up and you can no longer do anything on that view. If you switch to Month Year or day view the app works fine just on the week view
could not read data from '/Users/xxxx/Desktop/Calendar-master/Pods/Target Support Files/OSCache/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
could not read data from '/Users/xxxx/Desktop/Calendar-master/Pods/Target Support Files/OrderedDictionary/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
Hello Julien,
Thanks for this awesome Calendar
Just wanted to ask you will there be update in your control for IPhone Compatibility??
Thanks
Milap
I am getting an endless loop on some occasions. It looks something like the attached image in XCode.
It looks like a loop in MGCDayPlannerView with these 3 methods:
I'm not exactly sure how to break the loop properly. Your input would be appreciated. :-)
Getting this error when already have events for tomorrow or further, and trying to add new with reloadEvents() for today. How could I fix this?
I see in some of the screenshots on the repository that there is a transparent bar under the header, but when I add the calendar in my project there is always this gray bar that is not transparent. So I would like to know how to set an alpha on it, so I could actually put it to 0, if there is a way of removing it, even better.
Hi love your calendar by the way.
Is there a way that the scroll will not be laggy? When the events reaches 200 in a single day when scrolling its laggy.
Hi, I have events with date from July 7 to July 15, how to I set the start date for week view controller?
If i manually change dates to July 20 or above, I see them on the week view, but all earlier dates do not appear when I scroll to their date.
Please advise.
Thanks in advance.
Julien:
really nice library. I am having an issue where events that are side-by-side do an odd overlap.
Image 1 - the event on the left overlaps with the one on the right. If I scroll from right-to-left, I can see that the appointment on the right creeps over to the next column (Image 2)
Image 3 - If I rotate the device, it redraws, but there seems to be a space between the 2 events
Image 4 - If I rotate back to portrait, the cells align properly
If I scroll the events vertically out of view, and then scroll them back in, they end up drawing like in 'Image 1' again.
Any ideas why this would be happening? Nothing in your code is immediately obvious. Also, I have an iPhone demo running. I could give it to you and you can tweak it to your liking.
Many thanks
i download this demo
i build the project that time occur error is below
error: could not read data from '/Users/mypc/Downloads/Calendar-master-2/Pods/Target Support Files/OrderedDictionary/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
could not read data from '/Users/mypc/Downloads/Calendar-master-2/Pods/Target Support Files/OrderedDictionary/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
Very thank you for your SDK. I got a problem that I need to page all the weekView, it is just like google's tiny calendar, it can scroll seven days when user scroll the screen, can you give me some tips to reach the same function? May you can provide a property set it ? I am waiting for you message, thank you! this is the connect of google's tiny calendar https://itunes.apple.com/us/app/tiny-calendar-sync-google/id514917848?mt=8
Hello, Thanks for your great Calendar library. In the one of the latest release I notices that there is lag when moving between dates. Using profile I came to know that this function is taking long time to return answer. The old way use Date for the calculation while the new function use the Calendar to do the job. But the Calendar way involve many other time consuming tasks. Can you check please?
- (MGCDateRange*)scrollableTimeRangeForDate:(NSDate*)date
Hello, Jumartin
Thank you for your project. Now I am building calendar app based on your repo in swift.
I want to scroll left and right for Month and Yearview, currently, your sample is only scrolling top-to bottom, bottom-top to view prev or next month & Year.
Please let me know what is your suggestion to change this code.
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.