Hi all ,
When i set the DNN culture to arabic - saudi arabia , the DNN DateEdit control doesn't work proeprly , it seems that the DNN is not working well with Hijri calendar
Because the "Website\admin\Modules\modulesettings.ascx" control will not insert the Datas correctly to the database !
for example , when you go to module settings ,and under advanced settings , and when you try to set the module start date and End date , an invalid date will be parsed and inserted to the database , something like 1987 ....
I looked at the source code and the way they are parsing the date from Textboxes , They sed Convert.ConvertToDateTime(.....
And it seems that funcion will fail in hijri calendar ,
I tried this code in my custom modules and it wokred well for both en-US and arabic saudi arabia ( ar-SA)
public static DateTime ParsedateString(string DateStr)
{
return DateTime.ParseExact(DateStr, DateTimeformatInfo.CurrentInfo.ShortDatePattern, new CultureInfo("en-US"));
}
I'm using it by passing the DateTimeEdit Control value to that function , and it correctly returns the correct date object .
I also tried to pass a custom format for the DateTimeEdit Control (Via its Custom Attributes property) and i didn't get any positive result ,I'm not sure if its a bug or there is something I'm missing !
Thanks for any help .