Skip to content

Commit

Permalink
Final Version
Browse files Browse the repository at this point in the history
  • Loading branch information
clover-yan authored May 9, 2023
1 parent 049efd5 commit fad5e27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DateCountdown/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ private void DispatcherTimer_Tick(object sender, EventArgs e)
// {
// timeSpan = new DateTime(year, 6, 8, 17, 0, 0) - DateTime.Now;
// }
TextBlockDays.Text = ((detailNum < 0.0) && neg ? "-" : "") + Math.Abs(timeSpan.Days).ToString();
double detailNum = (timeSpan.Hours * 3600000 + timeSpan.Minutes * 60000 + timeSpan.Seconds * 1000 + timeSpan.Milliseconds) / 86400000.0;
TextBlockDays.Text = ((detailNum < 0.0) && neg ? "-" + Math.Abs(timeSpan.Days).ToString() : Math.Abs(timeSpan.Days).ToString());
if (redText || ((!greenText) && (timeSpan.Days < 100)))
{
TextBlockDays.Foreground = Brushes.Red;
}
double detailNum = (timeSpan.Hours * 3600000 + timeSpan.Minutes * 60000 + timeSpan.Seconds * 1000 + timeSpan.Milliseconds) / 86400000.0;
string detailStr = Math.Abs(detailNum).ToString(StringFormat);
if (detailStr.StartsWith("1."))
{
Expand Down

0 comments on commit fad5e27

Please sign in to comment.