Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Created Unassigned: DateTimePicker.FormatString throws Exception [20038]

$
0
0
When we sets value to DateTimePicker.FormatString, unwanted exception may be occured.

FormatString property validates value by internal static IsFormatStringValid method, CultureInfo.CurrentCulture is used there. CurrentCulture returns value is dependent on the operating system setting, it has Calendar property.

For example, There are 2 types of calendars in Japan. One is "Seireki", another one is "Wareki". "Seireki" is operation system default setting and is represented by GregorianCalendar class. "Wareki" is japanese traditional almanac and is represented by JapaneseCalendar class. JapaneseCalendar supports from 1868/1/1 to 9999/12/31 as gregorian almanac.

Because of IsFormatStringValid validates by using DateTime.MinValue, we encounter ArgumentOutOfRangeException if we use "Wareki". I think that If IsFormatStringValid validates by using Calendar.MinSupportedDateTime (or DateTime.Now, or DateTime.MaxValue and so on), we won't encounter it.

Extended WPF Toolkit is very useful and convenient library. So great. If you fix this issue, we will be more happy!!

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>