Skip to content

Commit

Permalink
Merge pull request #191 from HSCOO/master
Browse files Browse the repository at this point in the history
修复只设置年月时,选中颜色错乱
  • Loading branch information
yangyxd authored Sep 25, 2024
2 parents cd546f3 + 65d1d95 commit c47b3d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1290,8 +1290,10 @@ class DateTimePickerAdapter extends PickerAdapter<DateTime> {
_columnType = columnType[type];
var month = _columnType.indexWhere((element) => element == 1);
var day = _columnType.indexWhere((element) => element == 2);
_needUpdatePrev =
day < month || day < _columnType.indexWhere((element) => element == 0);
if (month != -1 && day != -1) {
_needUpdatePrev = day < month ||
day < _columnType.indexWhere((element) => element == 0);
}
if (!_needUpdatePrev) {
// check am/pm before hour-ap
var ap = _columnType.indexWhere((element) => element == 6);
Expand Down

0 comments on commit c47b3d5

Please sign in to comment.