daij-djan / ddcalendarview Goto Github PK
View Code? Open in Web Editor NEWa calendar view that looks like the ical view while supporting Drag & Drop (can show 1 day or a week - lots of IBDesignables)
License: BSD 2-Clause "Simplified" License
a calendar view that looks like the ical view while supporting Drag & Drop (can show 1 day or a week - lots of IBDesignables)
License: BSD 2-Clause "Simplified" License
Can we use this to create week view? Anybody tried this?
@Daij-Djan
file:///DDCalendarView-master/Demos/CalendarDemo_objc/Base.lproj/Main.storyboard: error: IB Designables: Failed to update auto layout status: The agent crashed
file:///DDCalendarView-master/Demos/CalendarDemo_objc/Base.lproj/Main.storyboard: error: IB Designables: Failed to render instance of DDCalendarView: The agent crashed
recently facing these two errors in storyboard live rendering
xcode version 7.3
iOS 9.2
- (void)calendarView:(DDCalendarView* _Nonnull)view didSelectEvent:(DDCalendarEvent* _Nonnull)event
when a event is selected it gives the wrong time can you tell me how to solve it @Daij-Djan
Hi,
I've tried to change the timeline constrain:
#define HEIGHT_CELL_HOUR 100.
in:
#define HEIGHT_CELL_HOUR 50.
But after this change, the Event Views aren't entered in the right time slot.
Example: if I've an event from 16pm to 18pm in the timeline result as like 16.15pm to 18.15pm.
As consequence the method
- (void)scrollDateToVisible:(NSDate* _Nonnull)date animated:(BOOL)animated;
doesn't scroll properly to the correct date.
Any way to fix it?
I want to use Calendar for a single day is there any possibility that we can disable horizontal scroll and use it for a single day.
Hi,
I am facing an issue,In my application I wan to reload the datas dynamically at different times.I am calling reloadData() but it is not entering in the delegate methods. I am using swift component
Thanks
Hi,
is support for multiple events at the same time in your library?
Hi,
All day event is not visible on the screen, we are using Swift
Thanks,
I was implementing it in a manner that calendar shows 12am to 12am and came to an issue when I change device's timezone the calendar then changes its display eg. for GMT it shows 12am to 12am and when I change it to IST is shows 5:30am to 5:30am
Please help!
Thanks in advance
Hi.... I love your library! But I have a problem with your swift example. Too complicate and does not work or show real word ussage on simulator in 3 minutes....
I think here is better DEMO for all swift players. Cheers.
import UIKit
import EventKit
import EventKitUI
class ViewController: UIViewController, DDCalendarViewDelegate, DDCalendarViewDataSource, EKEventViewDelegate {
@IBOutlet var calendarView: DDCalendarView!;
override func viewDidLoad() {
self.calendarView.scrollDateToVisible(Date(), animated: false)
}
/*
* Add your events and display them on screen
*/
func events(forDay dayMod: Int) -> [Any] {
let event2 = DDCalendarEvent()
event2.title = "Demo Event 2"
event2.dateBegin = NSDate(hour: 17, min: 0, inDays: dayMod) as Date!
event2.dateEnd = NSDate(hour: 19, min: 0, inDays: dayMod) as Date!
let event3 = DDCalendarEvent()
event3.title = "Demo Event 3"
event3.dateBegin = NSDate(hour: 15, min: 50, inDays: dayMod) as Date!
event3.dateEnd = NSDate(hour: 16, min: 0, inDays: dayMod) as Date!
return [event2, event3]
}
//display events for today
func calendarView(_ view: DDCalendarView, eventsForDay date: Date) -> [Any]? {
let newDate = date as NSDate
let daysMod: Int = newDate.days(from: Date())
let newE: [DDCalendarEvent] = self.events(forDay: daysMod) as! [DDCalendarEvent]
var dates = [Any]()
for e: DDCalendarEvent in newE {
// if e.dateBegin == date || e.dateEnd == date {
dates.append(e)
// }
}
return dates
}
public func calendarView(_ view: DDCalendarView, viewFor event: DDCalendarEvent) -> DDCalendarEventView? {
let view = DDCalendarEventView(event: event)
view?.backgroundColor = UIColor.red.withAlphaComponent(0.5)
view?.layer.borderColor = nil
view?.layer.borderWidth = 0
return view
}
func eventViewController(_ controller: EKEventViewController, didCompleteWith action: EKEventViewAction) {
self.dismiss(animated: true, completion: nil)
}
}
Hi,
I am setting the time zone as UTC for dateBegin and dateEnd. But while displaying events on calendar, it is taking the time zone as +530 and showing events on the wrong time.
Please help.
i have update event and try to reloadData() but it still not update event View?
Hi @Daij-Djan
I am facing a issue where I am unable to reload the DDCalendarView.
Issue Description:
I am using the RESTFUL API in my app. Once I got the data response, filled the ddcalendarEvent dictionary & reload the DDCalendarView, but the data are not shown in UI even though there is data available in the DDCalendarEvent Variables. Sorry for bothering you. If I am wrong some where please correct me.
Note : the date is in UTC format.
Hi,
When I first fired the demo app I put it in portrait (constraint in my app) and didn't even notice it was showing 7 days because I expected at least some border between days. I think it would be nice to be able to draw a vertical line between each day. Is this possible? If yes, how can we customise that? If no, can this be added with color customisation?
Thank you
Sébastien
I am trying to change event color in the swift code but it's not taking. i am giving like this
event.userInfo = ["color":UIColor.yellow]
I have some case when all view are drawing, few are overlapping. Drawing should be equal in width. So
I just want to scroll view need to show current time onwards event.Later user can scroll. So suppose if any event starting in 5 Pm then scroll view should load from 4 PM, scrolling again can see all event.
Can we add another view for canceling (like cross icons or image) the events in DDCalendar view ? IF yes then please how to add it ?
Here is problem method. The comended piece is the problem one.
(void)setEvent:(DDCalendarEvent )event {
_event = event;
/
assert(event.title.length);
assert(event.dateBegin);
assert(event.dateEnd);*/
self.label.text = [NSString stringWithFormat:@"%@\n\n%@\n%@", event.title, event.dateBegin.stringWithTimeOnly, event.dateEnd.stringWithTimeOnly];
[self.label sizeToFit];
}
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.