class %ZEN.Component.dateSelect
extends control
A specialized input control for handling date values.
This control allows the user to view and edit a date value
via a set of comboboxes, one for year, month, and day of month.
This is useful for cases like birth dates or expiration dates
where a popup calendar (as in the dateText component)
is cumbersome.
The logical value of this control takes the standard form
YYYY-MM-DD. You can change the order of the year, month, and day
dropdows using the format property.
Note that the standard HTML events (onfocus, onclick, etc.) are fired
for each of the select controls that make up this component.
Setting readOnly to true has the same effect
as disabling this component; this is the standard HTML behavior
for select controls.
parameter DEFAULTCONTROLCLASS = "dateSelect";
The default css class used for the main element within this control. This
is overridden by subclasses.
parameter DOMAIN = "%ZEN";
Localization domain
property format
as %ZEN.Datatype.string(MAXLEN=3,VALUELIST=",MDY,DMY,YMD,DM,MD,YM,MY,Y,M",ZENEXPRESSION=1) [ InitialExpression = "MDY" ];
This is a string that specifies the order in which the date
components are to be displayed.
Possible values are:
- "MDY" - Month,Day,Year
- "DMY" - Day,Month,Year
- "YMD" - Year,Month,Day
- "YDM" - Year,Day,Month
- "DM" - Day,Month
- "MD" - Month,Day
- "YM" - Year,Month
- "MY" - Month,Year
- "Y" - Year
- "M" - Month
property maxYear
as %ZEN.Datatype.integer(ZENEXPRESSION=1);
Optional.
If specified, this is the latest year allowed by the calendar.
If not specified, the current year plus 20 is used.
property minYear
as %ZEN.Datatype.integer(ZENEXPRESSION=1);
Optional.
If specified, this is the earliest year allowed by the calendar.
If not specified, 1900 is used.
property monthList
as %ZEN.Datatype.csv(ZENLOCALIZE=1);
List of localized month names shown in the month combo box.
property shortMonth
as %ZEN.Datatype.boolean(ZENLOCALIZE=1) [ InitialExpression = 0 ];
If true (default is false) show the first 3 characters of month
names in the month dropdown.
Note, you can also control this by setting the value of the
monthList property.
property showMonthNumber
as %ZEN.Datatype.boolean(ZENLOCALIZE=1) [ InitialExpression = 0 ];
If true (default id false) show the ordinal month number along
with month names in the month dropdown.
method %DrawHTML()
Static HTML display method: draw the BODY of this component
as HTML.
Subclasses implement this in order to render the static HTML
contents of a component.
method focus()
[ Language = javascript ]
Client-side method to give input focus to this control.
method getDay()
[ Language = javascript ]
Return displayed day value.
method getMonth()
[ Language = javascript ]
Return displayed month value.
method getYear()
[ Language = javascript ]
Return displayed year value.
method isCompleteDate()
[ Language = javascript ]
Test if this is an complete date;
either all values are provided or no values are
provided.
method isValid()
[ Language = javascript ]
This method is called by the form validation mechanism to test
if the current contents of this control are valid.
Returns true if the control value is valid; false otherwise.
Subclasses can override this to provide specific behavior.
The default behavior is to return true.
method setProperty(property, value, value2)
[ Language = javascript ]
Set the value of a named property.