DateTimeFormat.AbbreviatedMonthNames adding a dot at the end of month's name

[亡魂溺海] 提交于 2019-11-29 15:41:14

Sadly I couldn't find anything in the configuration that pointed me in the right direction.

Ended with a nasty hack like this:

var cultura = CultureInfo.CreateSpecificCulture("es-MX");
if (cultura.DateTimeFormat.AbbreviatedMonthNames.First().EndsWith("."))
   cultura.DateTimeFormat.AbbreviatedMonthNames = cultura.DateTimeFormat.AbbreviatedMonthNames.Select(c => c.Substring(0, c.Length > 1 ? c.Length - 1 : 0)).ToArray();

and used that culture in the parsing.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!