aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx/UI/Helpers/TimeZoneConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx/UI/Helpers/TimeZoneConverter.cs')
-rw-r--r--src/Ryujinx/UI/Helpers/TimeZoneConverter.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Ryujinx/UI/Helpers/TimeZoneConverter.cs b/src/Ryujinx/UI/Helpers/TimeZoneConverter.cs
new file mode 100644
index 00000000..876d51f7
--- /dev/null
+++ b/src/Ryujinx/UI/Helpers/TimeZoneConverter.cs
@@ -0,0 +1,28 @@
+using Avalonia.Data.Converters;
+using System;
+using System.Globalization;
+using TimeZone = Ryujinx.Ava.UI.Models.TimeZone;
+
+namespace Ryujinx.Ava.UI.Helpers
+{
+ internal class TimeZoneConverter : IValueConverter
+ {
+ public static TimeZoneConverter Instance = new();
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+
+ var timeZone = (TimeZone)value;
+ return string.Format("{0} {1} {2}", timeZone.UtcDifference, timeZone.Location, timeZone.Abbreviation);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}