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

select just a single day #34

Open
openmotion opened this issue Jan 10, 2018 · 2 comments
Open

select just a single day #34

openmotion opened this issue Jan 10, 2018 · 2 comments

Comments

@openmotion
Copy link

hello
by default we can select one or more days, how can i limit to a single day ?
thanks

@LaxmanDroid
Copy link

use this piece of code :
calendarView.setSelectionType(SelectionType.SINGLE);

@amerelsayed1
Copy link

amerelsayed1 commented Apr 5, 2020

To handle single Click

calendarView.selectionManager = SingleSelectionManager(OnDaySelectedListener {
Log.e(" CALENDAR ", "========== setSelectionManager ==========");
Log.e(" CALENDAR ", "Selected Dates : " + calendarView.selectedDates.size);
if (calendarView.selectedDates.size <= 0)
return@OnDaySelectedListener;
val spf = SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH)
reservationTime = spf.format(calendarView.selectedDays[0].calendar.time)
// Log.e(" CALENDAR ", "Departure : DD MMM YYYY : " + formatDateToString(calendarView.getSelectedDays().get(0).getCalendar().getTime(), "dd MMM yyyy", ""));
// Log.e(" CALENDAR ", " Return : DD MMM YYYY : " + formatDateToString(calendarView.getSelectedDays().get(calendarView.getSelectedDates().size() - 1).getCalendar().getTime(), "dd MMM yyyy", ""));

    })

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

3 participants