CosmoCalendar
CosmoCalendar copied to clipboard
How to disable the past dates from current day?
Have you found any workaround for this problem?
Have you found any workaround for this problem?(2)
Have you found any workaround for this problem?(3)
Have you found any workaround for this problem?(4)
Have you found any workaround for this problem?(5)
Have you found any workaround for this problem?(6)
private fun disablePastCalendarDays(){
val c = Calendar.getInstance()
val disabledDaysSet: MutableSet<Long> = HashSet()
for (day in c.get(Calendar.DAY_OF_MONTH) downTo 1){
c.add(Calendar.DATE, -1)
disabledDaysSet.add(c.timeInMillis)
}
schedule_calendar_view.disabledDays = disabledDaysSet
}
private fun disablePastCalendarDays(){ val c = Calendar.getInstance() val disabledDaysSet: MutableSet<Long> = HashSet() for (day in c.get(Calendar.DAY_OF_MONTH) downTo 1){ c.add(Calendar.DATE, -1) disabledDaysSet.add(c.timeInMillis) } schedule_calendar_view.disabledDays = disabledDaysSet }
It works :)