diff --git a/ENI2/Controls/EditWindowBase.cs b/ENI2/Controls/EditWindowBase.cs index 4512d3c1..29790786 100644 --- a/ENI2/Controls/EditWindowBase.cs +++ b/ENI2/Controls/EditWindowBase.cs @@ -109,7 +109,7 @@ namespace ENI2.Controls thePicker.Value = new DateTime(year, month, day, hour, minute, 0); } catch (FormatException) { } - catch (ArgumentOutOfRangeException) { thePicker.Value = DateTime.Now; } + catch (ArgumentOutOfRangeException) { thePicker.Value = null; } } } @@ -126,7 +126,7 @@ namespace ENI2.Controls thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0); } catch (FormatException) { } - catch (ArgumentOutOfRangeException) { thePicker.SelectedDate = DateTime.Now; } + catch (ArgumentOutOfRangeException) { thePicker.SelectedDate = null; } } } diff --git a/ENI2/DetailBaseControl.cs b/ENI2/DetailBaseControl.cs index 70ecc986..1414ff28 100644 --- a/ENI2/DetailBaseControl.cs +++ b/ENI2/DetailBaseControl.cs @@ -298,7 +298,9 @@ namespace ENI2 int year = Int32.Parse(timevalText.Substring(4, 4)); thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0); } - catch (FormatException) { } + catch (Exception) { + thePicker.SelectedDate = null; + } } }