# HG changeset patch # User Brad Greco # Date 1560718537 14400 # Node ID 69e8ecdbbdd3b6a2e31687cae8b07915d3f06776 # Parent 2342e9459444ae398b76c37dfda6972b4521bf96 Fix schedule time not being saved on daily schedules. diff -r 2342e9459444 -r 69e8ecdbbdd3 ServerMonitor/Forms/CheckForm.cs --- a/ServerMonitor/Forms/CheckForm.cs Sun Jun 16 16:55:14 2019 -0400 +++ b/ServerMonitor/Forms/CheckForm.cs Sun Jun 16 16:55:37 2019 -0400 @@ -148,7 +148,7 @@ FailuresInput.Value = check.MaxConsecutiveFailures; FrequencyUnitsComboBox.SelectedItem = check.Schedule.Units; FrequencyUpDown.Value = check.Schedule.Frequency; - StartTimePicker.Value = new DateTime(1970, 1, 1) + check.Schedule.StartTime; + StartTimePicker.Value = AtTimePicker.Value = new DateTime(1970, 1, 1) + check.Schedule.StartTime; EndTimePicker.Value = new DateTime(1970, 1, 1) + check.Schedule.EndTime; // Populate the controls specific to this check type. checkControl?.LoadCheck(check); @@ -180,7 +180,12 @@ check.Timeout = (int)TimeoutInput.Value; check.FailStatus = (CheckStatus)SeverityComboBox.SelectedItem; check.MaxConsecutiveFailures = (int)FailuresInput.Value; - check.Schedule = new Schedule((FrequencyUnits)FrequencyUnitsComboBox.SelectedItem, (int)FrequencyUpDown.Value, StartTimePicker.Value.TimeOfDay, EndTimePicker.Value.TimeOfDay); + check.Schedule = new Schedule( + (FrequencyUnits)FrequencyUnitsComboBox.SelectedItem, + (int)FrequencyUpDown.Value, + (FrequencyUnits)FrequencyUnitsComboBox.SelectedItem == FrequencyUnits.Day ? AtTimePicker.Value.TimeOfDay : StartTimePicker.Value.TimeOfDay, + EndTimePicker.Value.TimeOfDay + ); // Attempt to update the check from the check control inputs. try {