Closed SunnyBamaniya closed 4 years ago
Hi, just use the components then, not the whole DayViewController
.
See example in ExampleNotificationController
Thanks @richardtop for the reply. I used ExampleNotificationController but now we need to add Multiple events without using calendar.
Can you please just help to come out from the issue. Thanks.
Please, attach the screenshot or mockup of what you're trying to achieve.
It doesn't show one event at a time, please check examples. It shows any number of events you pass by the DayViewDataSource.
What is the contents of the array?
Sent with GitHawk
How can we increase spacing (height) between to hours like 9:00 AM to 10:00?
Take a look into verticalDiff property of the CalendarStyle
Sent with GitHawk
this is our code and we are unable to view multiple data using Only "TimelineContainer" Can you just late us where i am wrong.
i also attach json file here. JSON.txt
Please, configure an example project and attach it here, so I could run it locally.
Hello Richardtop, Here i attach sample project. also let us know how can i get value of selected timeline.
Thanks
Hello @richardtop Can have any feedback on above example?
Hi, I hope to check it next week.
SampleTesting.zip @SunnyBamaniya you had an error in layout. Please, learn more about UIKit and how to do manual / auto layout. I fixed your issue to make the Calendar occupy the whole view.
If you have CalendarKit-specific questions, feature requests or bug reports (e.g. something doesn't work, or you'd like to have new features implemented) feel free to ask them here.
However, if your question is a generic programming questions (e.g. how to compose multiple views to achieve some result), it's better to ask it on the StackOverflow with tag CalendarKit. You might get help faster there.
Hi, just use the components then, not the whole
DayViewController
. See example in ExampleNotificationController
Hey @richardtop
I tried this solutions and it's working perfectly. But is it possible to add multiple event for same datetime. Currently I have added 2 events and second one is with large duration but its overlapping first one. Can you help on this?
Send a screenshot please. Definitely should be possible.
Sent with GitHawk
Hi @EAmey Can you share your example? How you set 2 events using ExampleNotificationController.
Hello @richardtop I just want to add multiple events using ExampleNotificationController.
here I tried in ViewController.swift but unable to add multiple events. SampleCalendar.zip
@SunnyBamaniya Please find code as below
lazy var timelineContainer: TimelineContainer = {
let timeline = TimelineView()
timeline.frame.size.height = timeline.fullHeight
timeline.eventViewDelegate = self
var currentCalendar = Calendar(identifier: .gregorian)
currentCalendar.locale = Locale.current
currentCalendar.timeZone = TimeZone.current
timeline.calendar = currentCalendar
let timelineStyle = TimelineStyle()
timelineStyle.dateStyle = .twelveHour
//timelineStyle.verticalDiff = 60.0
timeline.updateStyle(timelineStyle)
let container = TimelineContainer(timeline)
container.contentSize = timeline.frame.size
container.backgroundColor = .white
container.addSubview(timeline)
container.isUserInteractionEnabled = true
return container
}()
func getEventDataForDate()
{
timelineContainer.timeline.date = self.dateSelected ?? Date()
timelineContainer.timeline.layoutAttributes.removeAll()
if let arrTask = TimesheetTasks.getEventsForDate(date: timelineContainer.timeline.date)
{
for task in arrTask
{
//working with 12 hours format only
let event = Event()
event.startDate = task.startTime
event.endDate = task.endTime
event.textColor = .white
event.color = .red
var info = ["\(task.taskName ?? "Task")"]
info.append("\(task.projectName ?? "Project")")
info.append("\(task.startTime.format(with: "hh:mm")) - \(task.endTime.format(with: "hh:mm"))")
event.text = info.reduce("", {$0 + $1 + "\n"})
arrEvents.append(EventLayoutAttributes(event))
}
timelineContainer.timeline.layoutAttributes = arrEvents
return
}
}
Hello @richardtop How can we configure timing instead of 12 am - 12 am to 09 AM - 06 PM?
Currently it's impossible (see #34). If you don't have any further questions, I'll close this issue.
New Issue Checklist
Issue Description
Code I'm using with CalendarKit
Result I am trying to achieve
[INSERT API OR UI MOCKUPS HERE]