Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

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

Open
iosPayal opened this issue May 16, 2020 · 1 comment

Comments

@iosPayal
Copy link

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 ....

@khushbupatel64
Copy link

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()

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants