mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 12:19:12 +00:00
Stringify Time Zones like Horizon
This commit is contained in:
parent
87f238be60
commit
a8eb25441c
2 changed files with 17 additions and 2 deletions
|
@ -17,7 +17,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
}
|
||||
|
||||
var timeZone = (TimeZone)value;
|
||||
return string.Format("{0} {1} {2}", timeZone.UtcDifference, timeZone.Location, timeZone.Abbreviation);
|
||||
return timeZone.ToString();
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace Ryujinx.Ava.UI.Models
|
||||
{
|
||||
internal class TimeZone
|
||||
public class TimeZone
|
||||
{
|
||||
public TimeZone(string utcDifference, string location, string abbreviation)
|
||||
{
|
||||
|
@ -9,6 +9,21 @@ namespace Ryujinx.Ava.UI.Models
|
|||
Abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
public string ToString()
|
||||
{
|
||||
// Prettifies location strings eg:
|
||||
// "America/Costa_Rica" -> "Costa Rica"
|
||||
var location = Location.Replace("_", " ");
|
||||
|
||||
if (location.Contains("/"))
|
||||
{
|
||||
var parts = location.Split("/");
|
||||
location = parts[1];
|
||||
}
|
||||
|
||||
return $"{UtcDifference} - {location}";
|
||||
}
|
||||
|
||||
public string UtcDifference { get; set; }
|
||||
public string Location { get; set; }
|
||||
public string Abbreviation { get; set; }
|
||||
|
|
Loading…
Reference in a new issue