YYCalendar icon indicating copy to clipboard operation
YYCalendar copied to clipboard

how to highlight selected date in calendar, if user has already selected specific date from calendar

Open iosPayal opened this issue 5 years ago • 1 comments

Provided YYCalendar pod works me and its easy to implement. Need to implement the one more feature in my project to show the selected day in calendar. Kindly guide ....

iosPayal avatar May 16 '20 10:05 iosPayal

In Normalcalender.swift file Please replace with below code.

public init(langType type: LangType, date: String, format: String, completion selectHandler: @escaping SelectHandler) { super.init(nibName: nil, bundle: nil) self.langType = type self.dateFormat = format self.inquiryDate = Useful.stringToDate(date, format: self.dateFormat)! self.selectHandler = selectHandler self.setupLangType() self.selectedDate = date let selctedDateData = selectedDate?.toDateFormat(withFormat:"yyyy/MM/dd") let dateData = selctedDateData ?? Date() let calendar = Calendar.current let components = calendar.dateComponents([.year,.month,.day,.weekday], from: dateData) todayYear = components.year! todayDay = components.day! print(todayDay) todayMonth = components.month! self.setupDate()

}

khushbupatel64 avatar Aug 01 '22 04:08 khushbupatel64