# IupDatePick

Definition: | include pGUI.e Ihandle ih = IupDatePick(string attributes="", dword_seq args={})
Description: | Creates a date editing interface element, which can drop-down a calendar for selecting a date. In Windows is a native element. In GTK and Motif is a custom element. In Motif is not capable of displaying the calendar. For more information on the attributes and args parameters see IupSetAttributes. Returns the identifier of the created element.
pwa/p2js: | Supported, but see +x? markers on individual attributes and callbacks.
See Also: | IupCalendar
Notes: | In Windows, when the user navigates to other pages in the calendar the date is not changed until the user actually selects a day. In Windows, FORMAT can have the following values, but other text in the format string must be enclosed in single quotes:
Element | Description
--- | ---
"d" | The one- or two-digit day. (default)
"dd" | The two-digit day. Single-digit day values are preceded by a zero. (Set when ZEROPRECED=Yes)
"ddd" | The three-character weekday abbreviation.
"dddd" | The full weekday name.
"M" | The one- or two-digit month number. (default)
"MM" | The two-digit month number. Single-digit values are preceded by a zero. (Set when ZEROPRECED=Yes)
"MMM" | The three-character month abbreviation. (Set when MONTHSHORTNAMES=Yes)
"MMMM" | The full month name.
"yy" | The last two digits of the year (that is, 1996 would be displayed as "96"). (Not recommended)
"yyyy" | The full year (that is, 1996 would be displayed as "1996"). (default)
For an example of IupDatePick see demo\pGUI\calendar.exw
Attributes: |
CALENDARWEEKNUMBERS | Shows the number of the week along the year in the calendar. Default: NO.
FORMAT | [Windows Only] Flexible format for the date in Windows. For more information see "About Date and Time Picker Control" in the Windows SDK. The Windows control was configured to display date only without any time options. Default: "d'/'M'/'yyyy". See Notes above.
MONTHSHORTNAMES? | [Windows Only] Month display will use a short name instead of numbers. Must be set before ORDER. Default: NO. Names will be in the language of the system.
ORDER | Day, month and year order. Can be any combination of "D", "M" and "Y" without repetition, and with all three letters. It will set the FORMAT attribute in Windows. It will NOT affect the VALUE attribute order. Default: "DMY".
SEPARATOR | Separator between day, month and year. Must be set before ORDER in Windows. Default: "/".
SHOWDROPDOWN | (write-only) opens or closes the dropdown calendar. Can be "YES" or "NO". Ignored if set before map. In Windows, it works only for NO. (since 3.28)
TODAY | (read-only) Returns the date corresponding to today in VALUE format.
VALUE+ | the current date always in the format "year/month/day" (eg "%d/%d/%d"). Can be set to "TODAY". Default value is the today date.
ZEROPRECED? | Day and month numbers will be preceded by a zero. Must be set before ORDER in Windows. Default: No.
Callbacks: |
VALUECHANGED_CB | Called after the value was interactively changed by the user. function valuechanged_cb(Ihandle ih) ih: identifier of the element that activated the event.
also | MAP_CB, UNMAP_CB, DESTROY_CB, GETFOCUS_CB, KILLFOCUS_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB, K_ANY, HELP_CB: All common callbacks are supported.
Examples: | From demo\pGUI\IupCalendar.exw The IupDatePick is tucked away down left, the big ugly thing right and centre is an IupCalendar. A window similar to the latter will pop_up when you click on the little icon/down button.