Version

Autofilling the Year Field in WebDatePicker

WebDatePicker™ fills the year field automatically to four digits when your end-user enters 1 or 2 digits. However you can set a value between -1 and 99 using the control’s CenturyThreshold property to fill the year field automatically to the 20th or 21st century. If the property is set to -1, then autofill is disabled. If the entered year is less than or equal to the value of the property, then 2000 is added to the year field otherwise, if the entered year is more than the value and less than 100 then 1900 is added to the year field. For example, if you set the YearToFill property to a value of 45 and the end-user enters a year less than or equal to 45 then the WebDatePicker adds 2000 to the year; if the end-user enters a year more than 45 and less than 100 then 1900 is added to the year. By default, the CenturyThreshold property is set to 29.

In Visual Basic:

WebDatePicker1.CenturyThreshold = 45

In C#:

WebDatePicker1.CenturyThreshold = 45;

In JavaScript:

$find("WebDatePicker1").set_centuryThreshold(45);