-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hi @andersnm,
thank you for the library. I am using it over at ClosedXML. There is a small issue with AM/PM designators. It seems that AM/PM designator isn;t formatted into a culture-aware strings. As an example, for Czech language it should use
- odp. instead of AM (odpoledne in Czech)
- dop. instead of PM (dopoledne in Czech)
I believe it should be enough to modify a line in the FormatDate method to use passed culture instead of invariant one (Formatter.cs#L255):
var ampm = date.ToString("tt", CultureInfo.InvariantCulture);
.NET is already aware of these conventions and formats it correctly for tt format string (plus it's stored in CultureInfo.DateTimeFormat.AMDesignator and DateTimeFormat.PMDesignator).
It seems that same should not apply to the A/P. It seems that Excel always keeps a or p, regardless of a region.
I can make a PR if you are willing to merge it.

