Default Year for DateTimePicker when Entering Short Date

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 8 years ago by Mick
Version: 11.1.0542
Avatar
I understand that the DateTimePicker control is being phased out, but until I can fully remove it from my app, I have a question about text-entering the date in the short format.

When I type 12/31/29, it resolves to 12/31/2029.
When I type 1/1/30, it resolves to 1/1/1930.

Is there any way to set the cutoff year (i.e. any year < 80 will resolve to 20XX instead of 19XX)?

Thank you,
Mick

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mick,

For the text to DateTime conversion we are simply using the built-in .NET framework code to do it like:
return DateTime.Parse(stringValue, culture.DateTimeFormat);
You can set the DateTimePicker.ValueConverter property to another converter that does DateTime to string and back if you'd like to do different logic.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.