get the two selected dates for check in and check out using time square

459 Views Asked by At

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);
0

There are 0 best solutions below