DisplayDatePickerDialog Method

The DisplayDatePickerDialog method displays a date selection dialog.

Syntax

object.DisplayDatePickerDialog

(

i_DefaultDateAs Number = NULL,

i_ReturnDateFormatStyleAs

GrooveIntlDateFormatStyle= GrooveIntlDateFormatStyle_Short,

i_ShowTimeAs VARIANT_BOOL = False

) AsIGrooveSimpleDialogResult

Parameters

Parameter Description

i_DefaultDate

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

i_ReturnDateFormatStyle

Specifies the format style of the return date string.

i_ShowTime

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.

Remarks

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.

Example

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

Reference

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