java - 使用 time square 获取两个选定的入住和退房日期
问题描述
我想在 2 中显示入住和退房的第一个和最后一个日期textviews
我正在使用 timesquare Android studio 和 SelectionMode = RANGE 这是我的代码:
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);
解决方案
推荐阅读
- php - 不允许主机“localhost”连接到此 MariaDB 服务器
- python-3.x - 为什么我不能导入 numba.cuda.random 这个模块?
- javascript - 如何在字符串类型的变量中写入带引号的文本?
- c# - 一段时间后,在后台(iOS和Android)上传数据以一种奇怪的方式失败
- javascript - 如何在 chrome 扩展加载时执行 javascript?
- regex - REGEXEXTRACT - 是否可以有两个捕获
- python-3.x - Groupy Pandas 多列数据框以查找上个月的百分比变化
- javascript - 我想在模式中的所有内容上应用 Ajax,但它仅适用于循环中的第一个模式元素
- python - 关于日期操作python pandas的问题
- android - 关于如何让 onResume() 运行 onCreate() 代码的问题