DisplayDatePickerDialog Method

The DisplayDatePickerDialog method displays a date selection dialog.




i_DefaultDateAs Number = NULL,


GrooveIntlDateFormatStyle= GrooveIntlDateFormatStyle_Short,

i_ShowTimeAs VARIANT_BOOL = False

) AsIGrooveSimpleDialogResult


Parameter Description


Specifies the date to be selected in the date picker when it is displayed.


Specifies the format style of the return date string.


Specifies whether the dialog should contain a control that grants the user the abilityto select the time of day.

Return Value

The return value is an IGrooveSimpleDialogResult object. This object indicates whether the user approved or cancelled the dialog and contains the formatted date string. If the user clicked the OK button, the IGrooveSimpleDialogResult.Result element has a value of GrooveDialogBoxResultCode_OK and the IGrooveSimpleDialogResult.Data element has the formatted date string. If the user cancels, the IGrooveSimpleDialogResult.result element has a value of GrooveDialogBoxResultCode_Cancel.


This method displays a modal dialog and should not be called from a script when a transaction is open. Macros are run within an open transaction; consequently, this method should not be called from a macro. See Accessing Forms Records for more information on this restriction.


The following JavaScript displays two date picker dialogs and uses the results to set the values of fields on the form. The first call to DisplayDatePickerDialog uses the default input parameters. The second call specifies the default date to display to the user and the format to use when returning the date string, and it also specifies that the dialog should contain a control for the time of day.

var dateDialog = GetApp().DisplayDatePickerDialog();
  if (dateDialog.Result == GrooveDialogBoxResultCode_OK)
    SetHTMLFieldValue("StartDate", dateDialog.Data);

  var testDate = GetApp().ParseDate("2007-01-01", GrooveIntlDateFormatStyle_Short );
  dateDialog= GetApp().DisplayDatePickerDialog(testDate, GrooveIntlDateFormatStyle_Short, true);
  if (dateDialog.Result == GrooveDialogBoxResultCode_OK)
    SetHTMLFieldValue("EndingDateTime", dateDialog.Data);

See Also


IGrooveFormsToolUIDelegate Interface
ClearStatusBarMessage Method
DisplayError Method
DisplayOKMessageBox Method
DisplayStatusBarMessage Method
DisplayTextInputDialog Method
DisplayYesNoMessageBox Method