gpt4 book ai didi

java - 将日期限制设置为 CalendarDatePickerDialogFragment android

转载 作者:行者123 更新时间:2023-12-01 10:33:03 24 4
gpt4 key购买 nike

我正在使用更好的选择器库 ( here's the link ) 在我的应用程序中选择日期。我想对选择器设置限制,使最大日期是今天的日期,最小日期不超过一年前。这是我显示 CalendarDatePickerDialogFragment 对话框的代码;

private void showDateDialog() {
FragmentManager fm = getSupportFragmentManager();
DateTime now = DateTime.now();
CalendarDatePickerDialogFragment calendarDatePickerDialogFragment = CalendarDatePickerDialogFragment
.newInstance(this, now.getYear(), now.getMonthOfYear() - 1,
now.getDayOfMonth());
calendarDatePickerDialogFragment.show(fm, FRAG_TAG_DATE_PICKER);
}

最佳答案

关于java - 将日期限制设置为 CalendarDatePickerDialogFragment android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34978965/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com