From 65d1d958744641f26bc65235fd2a14078c4e4221 Mon Sep 17 00:00:00 2001 From: HSCOO <371706801@qq.com> Date: Fri, 17 Feb 2023 18:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=B9=B4=E6=9C=88=E6=97=B6=EF=BC=8C=E9=80=89=E4=B8=AD=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/picker.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/picker.dart b/lib/picker.dart index 5620b4f..ec18f39 100644 --- a/lib/picker.dart +++ b/lib/picker.dart @@ -1284,8 +1284,10 @@ class DateTimePickerAdapter extends PickerAdapter { _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);