The date time picker control crashes when using foreign culture settings in windows e.g. German, Finnish.
These cultures use date stamps like 22.10.2014 1:05:07, 100
Iff you dont provide a custom FormatString the control will display, but wont allow interaction and will throw an uncaught exception if you attempt to open the calendar.
Additionally iff you stipulate a FormatString in XAML the app will crash with an XAML exception.
I tracked this bug in V 2.3 to the following:
DateTimeUpDown.cs line 559 - DateTime date = DateTime.Parse(Value.ToString());
I am not sure why this is there, Value is already a DateTime? so you can easily check if its null and if not extract the date time directly without using parse (an absolute nightmare function btw). Also upstream the Value is checked for null so worrying about null SHOULDN'T be an issue, although this would choke on null anyways.
My fix was: DateTime date = Value.Value;
Would still break on null, but SHOULD be safe to assume thats not an issue.
Maybe I am just having weird issues, but seems to be a bug to me.
Hope this helps :D
Comments: ** Comment from web user: Dysl3xik **
These cultures use date stamps like 22.10.2014 1:05:07, 100
Iff you dont provide a custom FormatString the control will display, but wont allow interaction and will throw an uncaught exception if you attempt to open the calendar.
Additionally iff you stipulate a FormatString in XAML the app will crash with an XAML exception.
I tracked this bug in V 2.3 to the following:
DateTimeUpDown.cs line 559 - DateTime date = DateTime.Parse(Value.ToString());
I am not sure why this is there, Value is already a DateTime? so you can easily check if its null and if not extract the date time directly without using parse (an absolute nightmare function btw). Also upstream the Value is checked for null so worrying about null SHOULDN'T be an issue, although this would choke on null anyways.
My fix was: DateTime date = Value.Value;
Would still break on null, but SHOULD be safe to assume thats not an issue.
Maybe I am just having weird issues, but seems to be a bug to me.
Hope this helps :D
Comments: ** Comment from web user: Dysl3xik **
Did this enable you to recreate the issue?