# Date Picker Control (INFLD)

> [HTML Version](datepickercontrol(infld).htm)

A date picker is a special kind of edit control designed only for the input of dates. It is created automatically by INFLD when called on to edit a date field (_type_ **D**) in GUI mode (**|G**). (It is not activated in the "lesser GUI mode", which you get with _type_ **|g**.) In the first example below, the field is being edited, but unlike with a normal field, the control selects one sub-field (month, day, or year) to edit at a time. You can either type digits, or use the Up/Down-Arrows, or use the Plus / Minus keys on the numeric pad, to increment/decrement the value. Use the Right-Arrow to move to the next sub-field.

(./images/ashref_img123.png)

If the date is optional (XMIN=0), a checkbox will appear. If unchecked, the date is grayed out and unavailable. To change it, first check the checkbox:

(./images/ashref_img124.png)

(./images/ashref_img125.png)

To display the calendar, click on the Down-Arrow button, or hit Alt+Down-arrow:

(./images/ashref_img126.png)

The format used by the date picker for editing and display is based on the localization settings of the client PC. But the format returned to the application is based on the INFLD _type_ codes and _xmax_ value. With _xmax_=6, only 2 digits of the year are turned. With _xmax_=8, the entire CCYY is returned. TYPE D uses American format (MM/DD/\{CC\}YY), TYPE U forces European (DD/MM/\{CC\}YY) format, and TYPE u selects the format from the language definition file (e.g. englsh.ldf\[1,6\]). TYPE > forces the date to be returned in CCYYMMDD format (most convenient for sorting, independent of country format).

See [Month Calendar Control](monthcalendarcontrol.md)for information on using the calendar control independently of an INFLD date field.

**Comment**

If you would like to implement your own date picker (i.e. your own calendar display associated with the INFLD date field), use the "lesser GUI mode" (**|g**) and set the _setdef_ parameter to "...", which will give you an INFLD date control which returns to you with EXITCODE=29 if the user clicks on the Down-arrow button. You can then pop up whatever kind of display you like to help the user select a date.

Or, to use the edit part of the date picker control, but replace the drop-down calendar part, use **|G** with **||v** (and set setdef = "..." as above).