Closed akki147 closed 3 years ago
Please attach screenshots and the sample code.
take a glance and you will find three errors :
@IBAction func changeViewTap(_ sender: UIButton) { sender.isHighlighted = false sender.isSelected = !sender.isSelected if sender.isSelected { self.btnChangevw.backgroundColor = .clear tblView.isHidden = sender.isSelected timeLineVw.isHidden = !sender.isSelected let controller = CustomCalendarExampleController() controller.view.frame = self.timeLineVw.bounds addChild(controller) self.timeLineVw.addSubview(controller.view) controller.didMove(toParent: self) }else { tblView.isHidden = sender.isSelected timeLineVw.isHidden = !sender.isSelected }
}
Please, share all the integration code you are using with the CK.
I hadn't done think except showing the calendar kit. this is the only code I had done.
Date instance you Are using is not giving the correct Date and Time
on debug I found issue on this function
Please Describe me what is provisioned time and timeline time and date offset hereafter I can place current time indicator on the correct place
dateToY
function, but stripped of of any time component (i.e. the date should start at exactly midnight in the current time zone)what is dateOnly function for why we passed calendar and style.verticaldifference is static so it is dependent constant or independent constant?
Problem Solved:----->
public func dateToY(_ date: Date) -> CGFloat { //let provisionedDate = date.dateOnly(calendar: calendar) let provisionedDate = date.toLocalTime() print("provisionedDate=====(provisionedDate)") let timelineDate = date.toLocalTime() // let timelineDate = self.date.toLocalTime() print("timelineDate=====(timelineDate)") // Calendar(identifier: .gregorian) var dayOffset: CGFloat = 0 if provisionedDate > timelineDate { // Event ending the next day dayOffset += 1 } else if provisionedDate < timelineDate { // Event starting the previous day dayOffset -= 1 } print("dayOffset( dayOffset)") let fullTimelineHeight = 23 style.verticalDiff //100 24 = 2400 full height of calendar // let hour = component(component: .hour, from: date.toLocalTime()) let hour = Calendar.current.component(.hour, from: Date()) print("hour--> (hour), (date)") //let minute = component(component: .minute, from: date.toLocalTime()) let minute = Calendar.current.component(.minute, from: Date()) let hourY = CGFloat(hour) style.verticalDiff + style.verticalInset let minuteY = CGFloat(minute) style.verticalDiff / 60 print("hourY, minuteY( hourY), ( minuteY)") print("hourY + minuteY + CGFloat(fullTimelineHeight) dayOffset---->(hourY + minuteY + CGFloat(fullTimelineHeight) dayOffset)") return hourY + minuteY + CGFloat(fullTimelineHeight) * dayOffset }
toLocal is the function to change the date in local of any timezone
Issue confirmed, fixed in 1.0.0. Please, update the library version you're using.
I am using this library as child to my accordance but the time indicator show the correct time but the place where it shows, is wrong? can you please help me out to get over from this issue.