It seems that browsers have a problem with the CultureInfo class when parsing DateTimes. Tested on IE and Chrome (Error messages are from Chrome):
Code: Select all
DateTime dt;
dt = DateTime.Parse(dtStr, CultureInfo.InvariantCulture);
--> TypeError: Cannot read property 'MemberwiseClone' of undefined
Code: Select all
DateTime.TryParse(dtStr, CultureInfo.InvariantCulture, DateTimeStyles.None, out dt);
--> Error: Memoized value is undefined.
No exception is thrown if using CultureInfo at the ToString() method, but the returned string-value is "undefined":
Code: Select all
var dtToString = dt.ToString(CultureInfo.InvariantCulture);
--> results in a string "undefined"
These bugs are not that critical but annoying - because in the debugger, all is working fine.. and for multi-language support, using the CultureInfo class would be nice..
Best Regards,
Christoph