Change date picker text: capitalize month
c#, datepicker
Solution
Specifying the `AbbreviatedMonthGenitiveNames`, `AbbreviatedMonthNames` along with the `ShortDatePattern` did the trick.
Thread.CurrentThread.CurrentCulture = new CultureInfo("es-MX")
{
DateTimeFormat = new DateTimeFormatInfo
{
AbbreviatedMonthGenitiveNames = new string[] { "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic", string.Empty },
AbbreviatedMonthNames = new string[] { "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic", string.Empty },
ShortDatePattern = "ddd dd/MMM/yyyy"
}
};
Yields:
Edit:
I have to add:
...
AbbreviatedDayNames = new string[] { "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"},
Too
Problem
I want to change the date picker by upper-casing the first letter of the month. Currently I'm using the set culture info in the thread and specify the format there, but for my culture the month is always all lowercase: ``` CultureInfo ci = new CultureInfo("es-MX"); ci.DateTimeFormat.ShortDatePattern = "ddd dd/MMM/yyyy"; Thread.CurrentThread.CurrentCulture = ci; ``` Displays: ``` Dom 19/ago/2012 ``` And I would like to have: ``` Dom 19/Ago/2012 ``` How can I change that?