pass DateTimeFormatInfo.CurrentInfo here instead of suppressing the warning

fixes 5ae15c8
This commit is contained in:
CasualPokePlayer 2023-11-08 11:58:38 -08:00
parent 5ae15c89c3
commit 282417c9af
1 changed files with 1 additions and 3 deletions

View File

@ -9,10 +9,8 @@ namespace BizHawk.Common
public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
{
if (value is not DateTime d || destinationType != typeof(string)) throw new NotSupportedException("can only do DateTime --> string");
#pragma warning disable CA1305
// this function is explicitly supposed to be locale dependent
return d.ToString();
#pragma warning restore CA1305
return d.ToString(DateTimeFormatInfo.CurrentInfo);
}
}
}