-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
无法设置默认时间 #12
Comments
需要检查一下默认时间是否与最大时间或最小时间的设定冲突了 |
麻烦试下这段代码: CardDatePickerDialog.builder(this)
.setTitle("123")
.setDisplayType(arrayListOf(
DateTimeConfig.YEAR, DateTimeConfig.MONTH, DateTimeConfig.DAY
))
.setBackGroundModel(CardDatePickerDialog.STACK)
.showBackNow(false)
.setDefaultTime(Calendar.getInstance().apply {
add(Calendar.MONTH, -2)
}.timeInMillis)
.setMaxTime(Calendar.getInstance().timeInMillis)
.setMinTime(Calendar.getInstance().apply {
add(Calendar.MONTH, -10)
}.timeInMillis)
.setWrapSelectorWheel(false)
.setThemeColor(Color.parseColor("#FF8000"))
.showFocusDateInfo(true)
.setOnChoose("选择") {
tvChooseDate.text = "◉ ${StringUtils.conversionTime(it, "yyyy-MM-dd HH:mm:ss")} ${StringUtils.getWeek(it)}"
}
.setOnCancel("关闭") {
}.build().show() |
找到问题了,在为numberpicker设置选择约束的时候设置了最大选择值,在特定情况下,选中值会大于设置的最大值,然后就重置为最大值了,这个逻辑有点问题。 |
好的,优秀! |
已更新 0.3.0 |
如果是自己获取默认时间戳,显示的默认时间是错的。
比如:
当设置了最大时间时,默认时间却不是当前时间前2个月的时间。不设置最大时间,显示就是正常的。
The text was updated successfully, but these errors were encountered: