Closed mhrastegari closed 7 months ago
Not only the year is not correctly been changed into jalali calender , but also the date thats been picked by the components is not the one that the compunents puts into its place holder.
There's not much we can do at this stage, I'd expect 1402, but I received 2024!
Use the following codes to change the culture info the way it works as you expect.
cultureInfo.GetType().GetField("_calendar", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(cultureInfo, new PersianCalendar());
cultureInfo.DateTimeFormat.AMDesignator = "ق.ظ";
cultureInfo.DateTimeFormat.PMDesignator = "ب.ظ";
cultureInfo.DateTimeFormat.ShortDatePattern = "yyyy/MM/dd";
cultureInfo.DateTimeFormat.AbbreviatedDayNames =
[
"ی", "د", "س", "چ", "پ", "ج", "ش"
];
cultureInfo.DateTimeFormat.ShortestDayNames =
[
"ی", "د", "س", "چ", "پ", "ج", "ش"
];
return cultureInfo;
The year should be Shamsi but instead shows Gregorian!