mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[Awake]Fix crash on negative timezone offsets (#25393)
* [Awake]Fix crash on negative timezone offsets * fix spellchecker
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
Mode = AwakeMode.PASSIVE;
|
||||
IntervalHours = 0;
|
||||
IntervalMinutes = 0;
|
||||
ExpirationDateTime = DateTimeOffset.MinValue;
|
||||
ExpirationDateTime = DateTimeOffset.Now;
|
||||
CustomTrayTimes = new Dictionary<string, int>();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
KeepDisplayOn = Properties.KeepDisplayOn,
|
||||
IntervalMinutes = Properties.IntervalMinutes,
|
||||
IntervalHours = Properties.IntervalHours,
|
||||
ExpirationDateTime = Properties.ExpirationDateTime,
|
||||
|
||||
// Fix old buggy default value that might be saved in Settings. Some components don't deal well with negative time zones and minimum time offsets.
|
||||
ExpirationDateTime = Properties.ExpirationDateTime.Year < 2 ? DateTimeOffset.Now : Properties.ExpirationDateTime,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user