fix: Fix potentially bad formats in culture info
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Cryville.EEW.Unity.UI {
|
|||||||
}
|
}
|
||||||
void SetView(float mainSeverity, string title, string location, CultureInfo culture) {
|
void SetView(float mainSeverity, string title, string location, CultureInfo culture) {
|
||||||
SetSeverity(mainSeverity);
|
SetSeverity(mainSeverity);
|
||||||
SetText(m_textView, string.Format("{0} {1}", title, location), culture);
|
SetText(m_textView, string.Format(culture, "{0} {1}", title, location), culture);
|
||||||
}
|
}
|
||||||
static void SetText(TMPLocalizedText view, string text, CultureInfo culture) {
|
static void SetText(TMPLocalizedText view, string text, CultureInfo culture) {
|
||||||
if (string.IsNullOrWhiteSpace(text)) {
|
if (string.IsNullOrWhiteSpace(text)) {
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ namespace Cryville.EEW.Unity.UI {
|
|||||||
time = TimeZoneInfo.ConvertTime(time, timeZone, tTimeZone);
|
time = TimeZoneInfo.ConvertTime(time, timeZone, tTimeZone);
|
||||||
else
|
else
|
||||||
tTimeZone = timeZone;
|
tTimeZone = timeZone;
|
||||||
_textView.text = SharedSettings.Instance.DoDisplayTimeZone ? string.Format(CultureInfo.CurrentCulture, "{0:G} ({1})", time, tTimeZone.ToTimeZoneString()) : time.ToString(CultureInfo.CurrentCulture);
|
_textView.text = SharedSettings.Instance.DoDisplayTimeZone ? string.Format(SharedCultures.CurrentCulture, "{0:G} ({1})", time, tTimeZone.ToTimeZoneString()) : time.ToString(SharedCultures.CurrentCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user