class %ZEN.Component.dateText
extends control
Input control specialized for handling date values.
This displays a text box as well as a button that
displays a popup calendar.
When the user enters a value into this control, it will
be converted into the closest matching date value or
and invalid date message.
Setting the value property of this control, will bypass
date matching.
The value of this control is always in the canonical form: YYYY-MM-DD,
you can, however, display a different format by setting the format
property.
parameter DEFAULTCONTROLCLASS = "dateTextInput";
The default css class used for the main element within this control. This
is overridden by subclasses.
parameter DOMAIN = "%ZEN";
Localization domain
property dayList
as %ZEN.Datatype.csv(ZENLOCALIZE=1);
List of localized day abbreviations shown at top of calendar.
If specified, this is passed on the popup calendar.
property firstDayOfWeek
as %ZEN.Datatype.integer(MAXVAL=6,MINVAL=0) [ InitialExpression = 0 ];
Specified which day of the week (Sunday=0, Saturday = 6) is displayed as
the starting day of the week.
This allows for customizing the calendar for locales where weeks start with
other days of the week.
This is passed on the popup calendar.
property format
as %ZEN.Datatype.string(MAXLEN=3,VALUELIST=",MDY,DMY,YMD",ZENEXPRESSION=1) [ InitialExpression = "YMD" ];
Optional. Specifies the display format used for this component.
(Note that the internal value of this control is always YYYY-MM-DD).
Possible values are:
- "YMD" - Year,Month,Day
- "MDY" - Month,Day,Year
- "DMY" - Day,Month,Year
property image
as %ZEN.Datatype.uri [ InitialExpression = "portal/calendar_48.gif" ];
Optional. URL of the "show calendar" icon displayed within this control.
property invalidDateMessage
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Invalid Date","%ZEN") ];
Localized "invalid date" message displayed by control.
property maxDate
as %ZEN.Datatype.string(ZENEXPRESSION=1);
Optional.
If specified, this is the latest date allowed by the calendar.
This is a date in the form "YYYY-MM-DD".
property minDate
as %ZEN.Datatype.string(ZENEXPRESSION=1);
Optional.
If specified, this is the earliest date allowed by the calendar.
This is a date in the form "YYYY-MM-DD".
property monthList
as %ZEN.Datatype.csv(ZENLOCALIZE=1);
List of localized month names shown at top of calendar.
If specified, this is passed on the popup calendar.
property onshowPopup
as %ZEN.Datatype.eventHandler;
onshowPopup event handler:
This event is fired just before the popup calendar is displayed.
It provides an opportunity to pass additional settings to the
popup calendar.
The argument, settings, passed to this callback, is
an object (associative array). Property values within this
object are passed on as setting to the calendar control.
For example:
settings['gapWidth'] = '100px';
property separator
as %ZEN.Datatype.string(MAXLEN=1,VALUELIST=",-,/,., ",ZENEXPRESSION=1) [ InitialExpression = "-" ];
Optional. Specifies the separator character used between date segments.
Note, if time is also displayed, the time separator is always ":".
property showTime
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, then this calendar will also display and allow the user
to edit the time of day portion of a date. In this case, the value
used by this control will be in xDBC timestamp format:
YYYY-MM-DD HH:MM:SS
property size
as %ZEN.Datatype.integer(MINVAL=0) [ InitialExpression = 15 ];
Size of the input area for this control.
property timeCaption
as %ZEN.Datatype.caption;
Localized caption for time input box (see showTime).
If specified, this is passed on the popup calendar.
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 adjustSize()
[ Language = javascript ]
Adjust size of control.
method applyDate(group)
[ Language = javascript ]
Apply the value from the popup to the input control.
method formatValue(val)
[ Language = javascript ]
Apply formatting to get displayed date value.
method isValid()
[ Language = javascript ]
This method is called by the form validation mechanism to test
if the current contents of this control are valid.
method keydownHandler(evt)
[ Language = javascript ]
Key down handler; trap ESC to avoid IE issues.
method onDisplayHandler()
[ Language = javascript ]
This client event, if present, is fired when the containing group is made visible.
method onRefreshContents()
[ Language = javascript ]
This client callback is called just from refreshContents
just after the new HTML is delivered from the server.
method ondatechangeHandler()
[ Language = javascript ]
onchange handler for this component.
method onloadHandler()
[ Language = javascript ]
Make sure that value is formatted correctly.
method setProperty(property, value, value2)
[ Language = javascript ]
Set the value of a named property.
method showDateSelector()
[ Language = javascript ]
Display date selector for this control.
method unformatValue(val)
[ Language = javascript ]
Remove formatting to get logical date value.