From 9b80ca4a8201a8c8a1d5113bde0269da00dac5b5 Mon Sep 17 00:00:00 2001 From: noberumotto Date: Thu, 10 Mar 2022 01:14:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E9=80=89=E6=8B=A9=E6=97=A5=E6=9C=9F=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI/Controls/DatePickerBar/DatePickerBar.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UI/Controls/DatePickerBar/DatePickerBar.cs b/UI/Controls/DatePickerBar/DatePickerBar.cs index b2e2b6f..5639fea 100644 --- a/UI/Controls/DatePickerBar/DatePickerBar.cs +++ b/UI/Controls/DatePickerBar/DatePickerBar.cs @@ -48,7 +48,11 @@ namespace UI.Controls.DatePickerBar var control = d as DatePickerBar; if (e.NewValue != e.OldValue) { - control.ScrollToActive(DateTime.Parse(e.NewValue.ToString())); + //DateTime newDateTime = DateTime.Now; + + DateTime.TryParse(e.NewValue.ToString(), out DateTime newDateTime); + + control.ScrollToActive(newDateTime); control.UpdateDateString(); } } -- GitLab