@PICKDATE — allows the user to select a date using a popup calendar control. The date may be returned in any output date format supported by this plugin. If no output format is specified, it defaults to the local date format with a four-digit year.

Syntax:
%@PICKDATE[title,initdate,fmt,startdate,enddate,flags,leftcol,dowmask,timeout]

titlethe caption for the popup. To include commas in the title, double-quote it.
initdatethe date selected by default when the dialog opens, in any supported input format; defaults to today’s date
fmtthe date format used to return the date; defaults to 256
startdate, enddatethe range of dates the user may select; see note below
flagsbitmapped value controlling miscellaneous features:
   2: remove the Cancel button; disable Esc and Alt-F4
   4: restrict the date range to 1980 through 2099
   128: don’t highlight holidays
   256: don’t allow the user to select holidays
leftcolday of the week in the left column; 1 = Monday, 2 = Tuesday, etc., or MON … SUN; defaults to local layout
dowmasklist of days of the week to disable
timeoutnumber of seconds before the popup automatically closes; 0 or not specified disables the countdown

Note: The startdate and enddate parameters can be entered in any of the usual input formats, with one exception. A number preceded by a + or - sign will be interpreted as an offset relative to initdate, not as an MS-DOS day number. In the unlikely event that you want to specify either startdate or enddate as a day number, either type it without a leading sign (e.g. 3766), or else prefix the letter D (e.g. D3766 or D-74324).

The date picker dialog allows the user to select a date using either the mouse or the keyboard. To select a date using the mouse, first browse to the desired month using the buttons at the top, to the left and right of the calendar’s header line. The inner pair of buttons display earlier or later months; the outer pair display earlier or later years. Once the desired month is shown, select the desired date by clicking on it, then click OK to close the dialog; or double-click on a date to select it and close the dialog immediately. (Note that it is possible to display months other than the one containing the selected date! The status line near the bottom always shows the currently selected date. Clicking on the status line will return the calendar display to the selected date.)

To select a date with the keyboard, use the arrow keys, PgUp, and PgDown to move the highlighted box. The left and right arrow keys move the selection one day backward or forward; up and down move it by one week; PgUp and PgDown move by months, and Ctrl-PgUp and Ctrl-PgDown move by years. When the desired date is selected, press Enter or click on the OK button.

Dates which are outside the specified range or otherwise disabled will appear in gray italics. You cannot select disabled dates using either the mouse or the keyboard. To cancel the dialog without selecting a date, click on Cancel or press Esc.

This function returns the user’s selected date in the specified format, or *CANCEL* if the user cancels the dialog.

For example:

set duedate=%@pickdate[Due Date,T+7,4,T,T+21,,,weekends]

Displays the date selection popup, with a caption of “Due Date”. The default due date is one week from today; the permitted range is from today through three weeks from today, and weekends are not allowed. The user’s selected date is returned in ISO 8601 format.

• Note: Holidays are highlighted by default. To disable this feature, add 128 to flags. For a list of the default annual holidays, see the QCAL command. For information on customizing the holidays, see Holidays.ini Format.

• New: This function does not exist in Take Command.