Skip to content

Commit

Permalink
Avoid out of range date
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Jul 26, 2023
1 parent 04b49c7 commit 508d3ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CelestiaUWP/TimeSettingDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ public sealed partial class TimeSettingDialog : ContentDialog, INotifyPropertyCh
{
public DateTimeOffset DisplayDate
{
get => Date.Date.AddMinutes(Time.TotalMinutes);
get
{
try
{
return Date.Date.AddMinutes(Time.TotalMinutes);
}
catch { return DateTime.Now; };
}
set
{
Date = value.Date;
Expand Down

0 comments on commit 508d3ee

Please sign in to comment.