code: protected void onDateClicked(@NonNull CalendarDay date, boolean nowSelected) {
      switch (selectionMode) {
        case SELECTION_MODE_MULTIPLE: {
          adapter.setDateSelected(date, nowSelected);
          dispatchOnDateSelected(date, nowSelected);
        }
        break;
        case SELECTION_MODE_RANGE: {
          final List<CalendarDay> currentSelection = adapter.getSelectedDates();
  
          if (currentSelection.size() == 0) {
            // Selecting the first date of a range
            adapter.setDateSelected(date, nowSelected);
            dispatchOnDateSelected(date, nowSelected);
          } else if (currentSelection.size() == 1) {
            // Selecting the second date of a range
            final CalendarDay firstDaySelected = currentSelection.get(0);
            if (firstDaySelected.equals(date)) {
              // Right now, we are not supporting a range of one day, so we are removing the day instead.
              adapter.setDateSelected(date, nowSelected);
              dispatchOnDateSelected(date, nowSelected);
            } else if (firstDaySelected.isAfter(date)) {
              // Selecting a range, dispatching in reverse order...
              adapter.selectRange(date, firstDaySelected);
              dispatchOnRangeSelected(adapter.getSelectedDates());
            } else {
              // Selecting a range, dispatching in order...
              adapter.selectRange(firstDaySelected, date);
              dispatchOnRangeSelected(adapter.getSelectedDates());
            }
          } else {
            // Clearing selection and making a selection of the new date.
            adapter.clearSelections();
            adapter.setDateSelected(date, nowSelected);
            dispatchOnDateSelected(date, nowSelected);
          }
        }
        break;
        default:
        case SELECTION_MODE_SINGLE: {
          adapter.clearSelections();
          adapter.setDateSelected(date, true);
          dispatchOnDateSelected(date, true);
        }
        break;
      }
    }
docs: Call by {@link CalendarPagerView} to indicate that a day was clicked and we should handle it.
  This method will always process the click to the selected date.
  
  @param date date of the day that was clicked
  @param nowSelected true if the date is now selected, false otherwise