Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable the past dates from current day? #41

Open
hamza-ahmed opened this issue Jan 25, 2018 · 8 comments
Open

How to disable the past dates from current day? #41

hamza-ahmed opened this issue Jan 25, 2018 · 8 comments

Comments

@hamza-ahmed
Copy link

No description provided.

@babarshamsi
Copy link

Have you found any workaround for this problem?

@devluckman
Copy link

Have you found any workaround for this problem?(2)

@LaxmanDroid
Copy link

Have you found any workaround for this problem?(3)

@ienground
Copy link

Have you found any workaround for this problem?(4)

@nikdevpub
Copy link

Have you found any workaround for this problem?(5)

@amerelsayed1
Copy link

Have you found any workaround for this problem?(6)

@nikdevpub
Copy link

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
}

@ienground
Copy link

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

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

No branches or pull requests

7 participants