feat: FluDatePicker修改月份时,若当前日存在于新的月份中则保持日不变,否则修改为新月份的最后一日

This commit is contained in:
Polaris-Night 2025-05-11 22:18:37 +08:00
parent 49e96b094b
commit b2fd3acda3
2 changed files with 10 additions and 0 deletions

View File

@ -178,7 +178,12 @@ FluButton {
}
if(type === 1){
text_month.text = model
let day = list_view_3.model[list_view_3.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
if(list_view_3.model.indexOf(day) === -1){
day = list_view_3.model[list_view_3.model.length - 1]
}
list_view_3.currentIndex = list_view_3.model.indexOf(day)
text_day.text = list_view_3.model[list_view_3.currentIndex]
}

View File

@ -178,7 +178,12 @@ FluButton {
}
if(type === 1){
text_month.text = model
let day = list_view_3.model[list_view_3.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
if(list_view_3.model.indexOf(day) === -1){
day = list_view_3.model[list_view_3.model.length - 1]
}
list_view_3.currentIndex = list_view_3.model.indexOf(day)
text_day.text = list_view_3.model[list_view_3.currentIndex]
}