TDatePicker displays a text box for date input purpose.
When the text box receives focus, a calendar will pop up and users can
pick up from it a date that will be automatically entered into the text box.
The format of the date string displayed in the text box is determined by
the DateFormat property. Valid formats are the combination of the
following tokens:
The date of the date picker can be set using the Date or Timestamp properties. The Date property value must be in the same format as the pattern specified in the DateFormat property. The Timestamp property only accepts integers such as the Unix timestamp.
TDatePicker has three Mode to show the date picker popup.
The CssClass property can be used to override the CSS class name for the date picker panel. The CalendarStyle property changes the overall calendar style. The following CalendarStyle values are available:
The InputMode property can be set to "TextBox" or "DropDownList" with default as "TextBox". In DropDownList mode, in addition to the popup date picker, three drop down list (day, month and year) are presented to select the date . When InputMode equals "DropDownList", the order and appearance of the date, month, and year will depend on the pattern specified in DateFormat property.
The popup date picker can be hidden by specifying ShowCalendar as false. Much of the text of the popup date picker can be changed to a different language using the Culture property.
The calendar picker year limit can be set using the FromYear and UpToYear properties where FromYear is the starting year and UpToYear is the last year selectable. The starting day of the week can be changed by the FirstDayOfWeek property, with 0 as Sunday, 1 as Monday, etc.
Note 1: If the InputMode is "TextBox", the DateFormat should
only NOT contain MMM
or MMMM
patterns. The
server side date parser will not be able to determine the correct date if MMM
or
MMMM
are used. When InputMode equals "DropDownList", all patterns can be used.
Note 2: When the TDatePicker is used together with a validator, the DateFormat property of the validator must be equal to the DateFormat of the TDatePicker AND must set DataType="Date" on the validator to ensure correct validation. See TCompareValidator, TDataTypeValidator and TRangeValidator for details.