Open openmotion opened 6 years ago
use this piece of code :
calendarView.setSelectionType(SelectionType.SINGLE);
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", ""));
})
hello by default we can select one or more days, how can i limit to a single day ? thanks