I am building a genealogical tree app, and I need to reach past this date. I would prefer DateTimePicker rather than TextBox + text-date conversion.
Is there anyway to circumvent this limitation?
Unfortunately, the DateTimePicker
control does not support dates before January 1, 1753. This is ultimately due to limitations in the Date and Time Picker and Month Calendar controls in the ComCtl32
Common Controls library. Those controls do not support dates before 1753 because that is the dividing line between the Gregorian and Julian calendars. Since the controls are based on the Gregorian calendar, they do not calculate dates consistent with the Julian calendar.
The reason this affects .NET code is because the DateTimePicker
class is a wrapper around the lower-level comctl32
controls. The relevant code is here.
Sadly, this limitation is also carried over into the Mono implementation of the control, so even if you use DateTimePicker
through Mono on Linux or Mac, it still will not allow dates before then, despite the lack of a comctl32.dll
in the operating system.
It looks like Telerik has their own DateTimePicker
control. That might be worthy of investigation. After a quick scan of the docs, though, I do not see what its limits are, if any.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With