Skip to main content

%ZEN.ComponentEx.schedulePane

class %ZEN.ComponentEx.schedulePane extends %ZEN.Component.component

Displays a daily schedule for a given time period as an HTML component. The schedule displays time slots for one or more days. User-defined scheduled items are placed on top of the appropriate time slots.

Controlling the Display of the Schedule

The view property controls what timespan is displayed: day, week, or month.
The date controls what time period is displayed. If a weekly view is used, then the week containing date is displayed.
The interval property specifies the size of each time slot in minutes.
while the cellHeight property specifies how tall each slot will be (in pixels).
The number of intervals displayed for each day is determined by the startTime and endTime properties; these provide the default starting and ending times for each day (in minutes from midnight). If there are scheduled items outside this range, additional slots are added to make the items visible.
When the user clicks on a cell, the onselectitem event handler is invoked. This handler is passed 2 variables: id-the user defined id value for a scheduled item as provided by the OnGetScheduleInfo callback (or null for an empty cell); and time-the time value associated with the cell (in yyyy-mm-dd hh:mm:ss format).

Providing Data for the Schedule

The scheduled items are provided by the user-defined server-side callback method OnGetScheduleInfo. This callback is passed an array of parameter values (from the parameters collection; the starting day value (as $H format) and the ending day value (also as $H format). It returns an array containing a list of items to display.
The array of scheduled items takes the form:
pInfo(day,time,n) = $LB(duration,id,text,type,style)
Where day is the day ($H) for the item; time is the start time (in minutes from midnight) for the item; n is a arbitrary number (typically 1) used just in case there are two or more items with the same day and time value. The data for each element contains duration, length of the item in minutes; id, a logical id value associated with this item (and passed on to the onselectitem event handler; text, text to display within the item; type, indicates the type of item: 0 is "unavailable" time slot and 1 is a scheduled time slot; style is option css style to apply to the time slot.
You can also provide day-wide styles by using the top-nodes of the array:
pInfo(day) = "css style for this day"


For example:
ClassMethod GetScheduleInfo(ByRef pParms As %String,pStartDate As %Date,pEndDate As %Date,ByRef pInfo As %List) As %Boolean
{
	// Display a 1 hour staff meeting for the first
	// day of this period.
	Set pInfo(pStartDate,9*60,1) = $LB(60,1,"Staff Meeting",1,"background: green;")
	Quit 1
}

Property Inventory

Method Inventory

Parameters

parameter DOMAIN = %ZEN;
Localization domain

Properties

property OnGetScheduleInfo as %ZEN.Datatype.delegator (FORMALSPEC = "&pParms:%String,pStartDate:%Date,pEndDate:%Date,&pInfo:%List", RETURNTYPE = "%Boolean");
Name of Server-side callback method to call to get information used to display the schedule.
This must be the name of a server-only method in the page class that contains this component.
Property methods: OnGetScheduleInfoDisplayToLogical(), OnGetScheduleInfoGet(), OnGetScheduleInfoIsValid(), OnGetScheduleInfoLogicalToDisplay(), OnGetScheduleInfoLogicalToOdbc(), OnGetScheduleInfoNormalize(), OnGetScheduleInfoSet()
property caption as %ZEN.Datatype.caption (ZENEXPRESSION = 1);
If provided, this text is displayed as a caption along the top of the schedule. The text is *not* HTML escaped, so that it can contain markup.
Property methods: captionDisplayToLogical(), captionGet(), captionIsValid(), captionLogicalToDisplay(), captionLogicalToOdbc(), captionNormalize(), captionSet()
property cellHeight as %ZEN.Datatype.length (ZENEXPRESSION = 1) [ InitialExpression = 30 ];
Height of time slot cell.
Property methods: cellHeightDisplayToLogical(), cellHeightGet(), cellHeightIsValid(), cellHeightLogicalToDisplay(), cellHeightLogicalToOdbc(), cellHeightNormalize(), cellHeightSet()
property date as %ZEN.Datatype.string (ZENEXPRESSION = 1);
Date to display (in YYYY-MM-DD format).
If not specified, the current day is used.
The schedule will display a range of days that contain this date value. The range of values depends on the current value of the view property.
Property methods: dateDisplayToLogical(), dateGet(), dateIsValid(), dateLogicalToDisplay(), dateLogicalToOdbc(), dateNormalize(), dateSet()
property dateFormat as %ZEN.Datatype.integer (MAXVAL = 17, MINVAL = -1) [ InitialExpression = -1 ];
Date format used for sub-caption. Refer to the $ZDT function for details.
Property methods: dateFormatDisplayToLogical(), dateFormatGet(), dateFormatIsValid(), dateFormatLogicalToDisplay(), dateFormatLogicalToOdbc(), dateFormatNormalize(), dateFormatSet()
property dayList as %ZEN.Datatype.csv (ZENLOCALIZE = 1);
List of localized day names.
Property methods: dayListDisplayToLogical(), dayListGet(), dayListIsValid(), dayListLogicalToDisplay(), dayListLogicalToOdbc(), dayListNormalize(), dayListSet()
property endTime as %ZEN.Datatype.integer (MAXVAL = 1440, MINVAL = 0, ZENEXPRESSION = 1) [ InitialExpression = 1080 ];
Ending time (in minutes from midnight) to show for the daily calendar.
Property methods: endTimeDisplayToLogical(), endTimeGet(), endTimeIsValid(), endTimeLogicalToDisplay(), endTimeLogicalToOdbc(), endTimeNormalize(), endTimeSet()
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 for locales in which weeks start with other days of the week.
Property methods: firstDayOfWeekDisplayToLogical(), firstDayOfWeekGet(), firstDayOfWeekIsValid(), firstDayOfWeekLogicalToDisplay(), firstDayOfWeekLogicalToOdbc(), firstDayOfWeekNormalize(), firstDayOfWeekSet()
property headerHeight as %ZEN.Datatype.length (ZENEXPRESSION = 1) [ InitialExpression = 40 ];
Height of header cells.
Property methods: headerHeightDisplayToLogical(), headerHeightGet(), headerHeightIsValid(), headerHeightLogicalToDisplay(), headerHeightLogicalToOdbc(), headerHeightNormalize(), headerHeightSet()
property interval as %ZEN.Datatype.integer (MINVAL = 5, ZENEXPRESSION = 1) [ InitialExpression = 30 ];
Specifies the size (duration) of the calendar slots (in minutes).
Property methods: intervalDisplayToLogical(), intervalGet(), intervalIsValid(), intervalLogicalToDisplay(), intervalLogicalToOdbc(), intervalNormalize(), intervalSet()
property monthList as %ZEN.Datatype.csv (ZENLOCALIZE = 1);
List of localized month names.
Property methods: monthListDisplayToLogical(), monthListGet(), monthListIsValid(), monthListLogicalToDisplay(), monthListLogicalToOdbc(), monthListNormalize(), monthListSet()
property onchangeview as %ZEN.Datatype.eventHandler;
onchangeview event handler: If defined, this event is fired when the user changes the view mode of the schedule (such as from month to day view).
Property methods: onchangeviewDisplayToLogical(), onchangeviewGet(), onchangeviewIsValid(), onchangeviewLogicalToDisplay(), onchangeviewLogicalToOdbc(), onchangeviewNormalize(), onchangeviewSet()
property onselectitem as %ZEN.Datatype.eventHandler;
onselectitem event handler: If defined, this event is fired when the user clicks on an item within the schedule.
Property methods: onselectitemDisplayToLogical(), onselectitemGet(), onselectitemIsValid(), onselectitemLogicalToDisplay(), onselectitemLogicalToOdbc(), onselectitemNormalize(), onselectitemSet()
property parameters as array of %ZEN.Auxiliary.parameter (XMLKEYNAME = "paramName", XMLNAME = "parameter", XMLPROJECTION = "ELEMENT");
User-defined set of parameters. These are passed along to the OnGetScheduleInfo callback method.
Property methods: parametersBuildValueArray(), parametersCollectionToDisplay(), parametersCollectionToOdbc(), parametersDisplayToCollection(), parametersGet(), parametersGetObject(), parametersGetObjectId(), parametersGetSwizzled(), parametersIsValid(), parametersOdbcToCollection(), parametersSet(), parametersSetObject(), parametersSetObjectId()
property selectedInterval as %ZEN.Datatype.integer (XMLPROJECTION = "none", ZENSETTING = 0);
Length (in minutes) of the current selected cell(s).
Property methods: selectedIntervalDisplayToLogical(), selectedIntervalGet(), selectedIntervalIsValid(), selectedIntervalLogicalToDisplay(), selectedIntervalLogicalToOdbc(), selectedIntervalNormalize(), selectedIntervalSet()
property selectedTime as %ZEN.Datatype.integer (XMLPROJECTION = "none", ZENSETTING = 0);
Start time of the current selected cell(s).
Property methods: selectedTimeDisplayToLogical(), selectedTimeGet(), selectedTimeIsValid(), selectedTimeLogicalToDisplay(), selectedTimeLogicalToOdbc(), selectedTimeNormalize(), selectedTimeSet()
property shortDayList as %ZEN.Datatype.csv (ZENLOCALIZE = 1);
List of localized short day names.
Property methods: shortDayListDisplayToLogical(), shortDayListGet(), shortDayListIsValid(), shortDayListLogicalToDisplay(), shortDayListLogicalToOdbc(), shortDayListNormalize(), shortDayListSet()
property shortMonthList as %ZEN.Datatype.csv (ZENLOCALIZE = 1);
List of localized short month names.
Property methods: shortMonthListDisplayToLogical(), shortMonthListGet(), shortMonthListIsValid(), shortMonthListLogicalToDisplay(), shortMonthListLogicalToOdbc(), shortMonthListNormalize(), shortMonthListSet()
property startTime as %ZEN.Datatype.integer (MAXVAL = 1440, MINVAL = 0, ZENEXPRESSION = 1) [ InitialExpression = 480 ];
Starting time (in minutes from midnight) to show for the daily calendar.
Property methods: startTimeDisplayToLogical(), startTimeGet(), startTimeIsValid(), startTimeLogicalToDisplay(), startTimeLogicalToOdbc(), startTimeNormalize(), startTimeSet()
property view as %ZEN.Datatype.string (MAXLEN = 20, VALUELIST = ",day,week,month", ZENEXPRESSION = 1) [ InitialExpression = "day" ];
Specifies what type of schedule to display.
Property methods: viewDisplayToLogical(), viewGet(), viewIsValid(), viewLogicalToDisplay(), viewLogicalToOdbc(), viewNormalize(), viewSet()

Methods

classmethod %DaysInMonth(y, m) as %Integer
Return number of days in the given year and month.
method %DrawHTML()
Draw the contents of this component.
method %DrawHeader()
Draw the header for the schedule.
method %DrawMonthView(ByRef pInfo, pStartDate As %Date, pEndDate As %Date)
Draw the month view for the schedule.
classmethod %FormatTime(pTime As %Integer) as %String
Take a time value (number of minutes from midnight) and return a formatted display value.
classmethod %GetMonthRange(pDate As %Date, Output pEndDate, pStartOfWeek As %Integer = 0) as %Date
Given a date (as a $H value), return the date (as a $H value) of the first and last dates to display for the month the date is in.
method %GetScheduleInfo(pStartDate As %Date, pEndDate As %Date, ByRef pInfo As %String) as %Status
Get an array (pInfo) containing info used to show the schedule.
This array is subscripted by item number.
classmethod %GetStartOfWeek(pDate As %Date, pStartOfWeek As %Integer = 0) as %Date
Given a date (as a $H value), return the date (as a $H value) of the start of the week the date is in.
pStartOfWeek indicates which is the starting day of the week (Sunday=0, Saturday = 6).
classmethod %IsLeapYear(y) as %Boolean
Return whether the given year is a leap year.
clientmethod getDropTimeSlot() [ Language = javascript ]
Return information about the most recent data drop. This is intended to be called from a ondrop handler.
It returns the time slot where the data was dropped in yyyy-mm-dd hh:mm:ss format or '' if data was not dropped on a valid slot.
clientmethod mouseClickHandler(evt, type, time, cellId, userId, duration) [ Language = javascript ]
Mouse click handler
type can be: -1 for unassigned slot, 0 for unavailable, 1 for booked item.
cellId is HTML id of the item
itemId is the user provided id of the item.
clientmethod mouseDownHandler(evt) [ Language = javascript ]
Grab mouse down to prevent text selection.
clientmethod moveToNewDay(delta) [ Language = javascript ]
Move ahead or back the given number of days.
clientmethod nextPeriod() [ Language = javascript ]
Display the next time period.
clientmethod onRefreshContents() [ Language = javascript ]
This client callback is called just from refreshContents just after the new HTML is delivered from the server.
clientmethod previousPeriod() [ Language = javascript ]
Display the previous time period.
clientmethod setDate(date) [ Language = javascript ]
Set the date mode of this control.
clientmethod setInterval(interval) [ Language = javascript ]
Set the interval property of this control.
clientmethod setProperty(property, value, value2) [ Language = javascript ]
Set the value of a named property.
clientmethod setView(view) [ Language = javascript ]
Set the view mode of this control.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab