aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Models
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Ava/UI/Models')
-rw-r--r--src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs b/src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs
index 98caceb5..3627ada9 100644
--- a/src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs
+++ b/src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs
@@ -1,4 +1,3 @@
-using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ui.App.Common;
using System;
using System.Collections.Generic;
@@ -14,20 +13,20 @@ namespace Ryujinx.Ava.UI.Models.Generic
public int Compare(ApplicationData x, ApplicationData y)
{
- string aValue = x.LastPlayed;
- string bValue = y.LastPlayed;
+ var aValue = x.LastPlayed;
+ var bValue = y.LastPlayed;
- if (aValue == LocaleManager.Instance[LocaleKeys.Never])
+ if (!aValue.HasValue)
{
- aValue = DateTime.UnixEpoch.ToString();
+ aValue = DateTime.UnixEpoch;
}
- if (bValue == LocaleManager.Instance[LocaleKeys.Never])
+ if (!bValue.HasValue)
{
- bValue = DateTime.UnixEpoch.ToString();
+ bValue = DateTime.UnixEpoch;
}
- return (IsAscending ? 1 : -1) * DateTime.Compare(DateTime.Parse(bValue), DateTime.Parse(aValue));
+ return (IsAscending ? 1 : -1) * DateTime.Compare(bValue.Value, aValue.Value);
}
}
} \ No newline at end of file