setCurrentDate does't trigger onDayClick event
Hello, when I call setCurrentDate, the event onDayClick is not being triggered. I need a way to simulate a user day clicking programmatically to show day events after month scroll or when I finish loading all current month events.
Is there any way to achieve this? I think this is needed.
Did you manage to solve this? I need it as well...
I don't remember exactly how I made, but I have a workaround that makes the tick:
I have a spinner to change current month, and I have this event:
Global var
private var currentFirstDayOfNewMonth: Date? = null
`this.slcMeses.onItemSelectedListener = object: AdapterView.OnItemSelectedListener{ override fun onNothingSelected(parent: AdapterView<*>?) {}
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
val hoy = Date()
val cal = Calendar.getInstance()
cal.time = currentFirstDayOfNewMonth as Date
cal.set(Calendar.MONTH, position)
if(hoy.getYear() == this.year && hoy.getMonth() == position){
cal.set(Calendar.DAY_OF_MONTH, hoy.getDayOfMonth())
}
else{
cal.set(Calendar.DAY_OF_MONTH, 1)
}
this.compactCalendarView.setCurrentDate(cal.time)
currentFirstDayOfNewMonth = compactCalendarView.firstDayOfCurrentMonth
}
}`
Hope this will help, I don't remember what I thought😂