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 add date as deactivated dates? #24

Open
azizainunnajib opened this issue Apr 11, 2018 · 5 comments
Open

How add date as deactivated dates? #24

azizainunnajib opened this issue Apr 11, 2018 · 5 comments

Comments

@azizainunnajib
Copy link

I can add every sunday or every monday as deactivated date. but, can i add a date (let's say 25 may 2019) as deactivated date? thank you. I know we should add integer as deactivated dates, but i can't add integer from parsing result of the date.

@savvisingh
Copy link
Owner

I didn't saw this use case for deactivating a specific date, but there is an option to make a date unavailable where u can pass a list of dates

@azizainunnajib
Copy link
Author

Can yo make an example please? I really understand but i dont know how. I search but get nothing. Thank you very much.

@savvisingh
Copy link
Owner

calendar.init(lastYear.getTime(), nextYear.getTime(), new SimpleDateFormat("MMMM, YYYY", Locale.getDefault())) //
.inMode(CalendarPickerView.SelectionMode.RANGE) //
.withSelectedDate(new Date())
.withHighlightedDates(arrayList)
.withDeactivateDates(new ArrayList<>(Collections.singletonList(7)));

@Shoaib3008757
Copy link

I can add every sunday or every monday as deactivated date. but, can i add a date (let's say 25 may 2019) as deactivated date? thank you. I know we should add integer as deactivated dates, but i can't add integer from parsing result of the date.
i am also asking answer for this, Please
i tried this withDeactivateDates(new ArrayList<>(Collections.singletonList(7)));
but it is not selecting single date

@savvisingh savvisingh pinned this issue Jan 17, 2019
@iomy
Copy link

iomy commented Aug 6, 2019

I dug a bit around the code and it seems there is a bit of a mix up. that "highlighted" functions as unavailable, which would explain that highlighted dates aren't selectable. also highlighted as you would imagine doesn't exist.
you can style the dates set with withHighlightedDates() like disabled (this only works in range mode): set color for "calendar_unavailable_bg" and "dateTimeRangePickerStateNonSelectable"

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

4 participants