Date-Time Control

GoldSim allows you to enter dates in Data elements (and expressions in other input fields) by enclosing the date in quotation marks. The format for referencing a date is determined by the Regional and Language time/date settings specified by the operating system.  For example, for a computer in the US, the following formats would all be valid ways for referencing October 1, 2009:

“10/1/2009”
“10-1-2009”
“October 1, 2009”
“1 October 2009”

A date is internally converted to a Julian time (in particular, the time since December 30, 1899 00:00:00). Hence, a date has dimensions of time.

You would typically reference a date in conjunction with DateTime, as shown below:

As a result, in some cases, you may need to enter a date or date and a time into a Dashboard. The Date-Time control allows you to easily enter dates directly via a Dashboard.  An example of its use is shown below:

The toolbar button looks like this:

Date-Time Control Toolbar Button

The Date-Time control looks like this when it is added to a Dashboard and selected:

The eight handles allow you to resize the control. For more precise changes, you can also change the width of the control using Ctrl-Left and Ctrl-Right, and change the height using Ctrl-Up and Ctrl-Down. (The default change is 1 pixel at a time. If you press the Shft key, the change is 5 pixels).

Note, however, that resizing the control does not resize the date strings inside the control; it simply adds empty space around the control.  The font size for the date strings is fixed (they use the default GUI font specified by the operating system).

Double-clicking on the control displays the following properties dialog:

Within the Value portion of the dialog, the Data element to which the control is to be linked is specified.  You do this by pressing <Click to select>.  This will display a browser that shows all of the scalar Data elements in the model that have units of time

Once you have linked the control to an element, the linked element will be listed:

You can remove the linkage (by pressing the red X button), or reassign the linkage (by pressing the name of the element itself).

The two Display radio buttons allow you to select whether you wish to edit only dates or both dates and times in the Dashboard:

The Start Date and End Date fields define the range of dates that the control will accept.  If the Dashboard user enters a date outside of this range, an error will be displayed, and the date will not be accepted. 

The Default Date can be used in conjunction with an optional Button control that the Author can provide in a Dashboard that allows the Player user to reset all input controls to default values.

   Note: Within GoldSim, you can reset all of the input controls in a Dashboard to their default values by right-clicking anywhere in the Dashboard, and selecting Set to Default Values.

By default, the Use Short Date box is checked.  If this box is cleared, a longer date string (that includes the day of the week) will appear in the Dashboard:

The Allow changes while paused check box determines whether Dashboard users will be able to edit the field in the middle of a simulation (i.e., after the model is paused).  If this check box is cleared (the default) the user can only edit the field prior to the start of the simulation.  If the model is paused, the field will not be editable.  If the check box is checked, the user will be permitted to edit the field while the model is paused in the middle of a simulation.

   Note: Even if this box is checked, if the model contains any scenarios, no changes can be made while the model is paused.

The bottom section of the dialog allows you to enter a tool tip, which will be displayed whenever the Dashboard user holds the mouse cursor over the control.

The Attributes tab of the dialog provides tools that allow you to hide or disable the control dynamically based on the values of various model outputs. This allows you, for example, to hide the control if it was not applicable under certain situations.

Related Topics…

Learn more about: