1

I want to get the first and last date for check-in and check-out to be displayed in 2 textviews I am using timesquare Android studio and SelectionMode = RANGE here is my codes :

public class SelectDates extends AppCompatActivity {
TextView checkin, checkout;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_dates);


        Date today = new Date();
        Calendar nextYear = Calendar.getInstance();
        nextYear.add(Calendar.YEAR, 1);

        checkin = (TextView)findViewById(R.id.checkin);
        checkout = (TextView)findViewById(R.id.checkout);

        final Button btnshowdates = (Button) findViewById(R.id.btnshowdates);
        final CalendarPickerView datePicker = findViewById(R.id.calendar);
        datePicker.init(today, nextYear.getTime())
                .inMode(CalendarPickerView.SelectionMode.RANGE)
                .withSelectedDate(today);
Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
jo10
  • 111
  • 6
  • Hi! I have not use it but there are methods `getSelectedDates()` and `setOnDateSelectedListener()`. I think it's what are you looking for. – Merov Nov 21 '18 at 11:42

0 Answers0