MonthCal2 is part of Calendar Pack2, which comprises DayCal2, ResourceCal2, MonthCal2 and NavCal. It allows appointments to be viewed, and manipulated by Drag-n-drop, as if on a calendar month page.
![]()
| Parameter Name | Description | |
|---|---|---|
| 1 | displayMonth | The first month to show on the calendar. Can be a month number or the name of a field (on either the home or the related table) containing the month number, or a calculation producing a month number. If a field name is used, it is NOT enclosed in quotes. |
| 2 | displayYear | The first year to show. Can be a number or the name of a field (on either the home or the related table) containing the year number, or a calculation producing a year number. If a field name is used, it is NOT enclosed in quotes. |
| 3 | "dateFieldName" | The field on the related table containing the appointment date. Must be of type Date. The field name needs to be enclosed in quotes and be the full TO::FieldName form. Note that the field name parameters should not be calc fields if you want to be able to update records. |
| 4 | "startTimeFieldname" | The field on the related table containing the Start Time of the appointment. Must be of type Time. The field name needs to be the full name and enclosed in quotes. |
| 5 | "durationFieldName" |
The field on the related table containing the Duration of the appointment. The field name needs to be the full name and enclosed in quotes. As an alternative to duration, you can use the 'EndDateFieldName' override to set an end timestamp field. This makes the calendar search for records much quicker and is recommended where possible, especially for databases with larger record sets. In this case, you can simply leave durationFieldName blank. |
| 6 | "descriptionFieldName" | The field on the related table containing the Description of the appointment. The field name needs to be the full name and enclosed in quotes. |
| 7 | "colorFieldName" (opt) |
The field on the related table containing the Color to be used for the appointment. The field name needs to be the full name and enclosed in quotes. Note that a hex or RGB() value is expected. |
| 8 | "titleFieldName" (opt) |
The field on the related table containing the Title to be used as the top line of the appointment. The field name needs to be the full name and enclosed in quotes. |
| 9 | actionOnApptSelect (opt) |
The name of the script or a command to run on selection of an appointment (useful for obtaining the record number of the record currently being edited). See note on Action Parameters below. |
| 10 | actionOnDayEnter (opt) |
The name of the script or a command to run on entry into a day. See note on Action Parameters below. |
| 11 | actionOnDaySelect (opt) |
The name of the script or a command to run on selection of a day. No script parameter should be used in this case: a script parameter, set to the date selected in format yyyy-mm-dd, is automatically generated. If a different date format is needed, use a script parameter of DateMask=. e.g. "Script=DaySelected|DateMask=d-m-Y". See note on Action Parameters below. |
MonthCal2(
// The Start Date
Month( DAYCAL_INTERFACE::Calendar DateStart g );
Year( DAYCAL_INTERFACE::Calendar DateStart g );
// Field Names
"DayCal_Interface to Appointments for WV::Start Timestamp" ;
"DayCal_Interface to Appointments for WV::Start Timestamp" ;
"DayCal_Interface to Appointments for WV::Duration" ;
"DayCal_Interface to Appointments for WV::Description" ;
"DayCal_Interface to Appointments for WV::c Colour Hex" ;
"DayCal_Interface to Appointments for WV::Title" ;
)
The calendar makes use of Record creation by a Double-Click. In order make this a seamless experience, we need to use a field to store a temporary ID so that we can find the newly created record. By default, the calendar uses the "Description" field, however if you create a field named "zCreationID" on your appointments table, the calendar will automatically use that instead.
Each of the functions in the Calendar Pack have optional Action parameters, allowing you to run a script or set a field when a field is selected. See Action Parameters for details.
Using a multi-line key on the left side of the relationship (the layout table) is possible, if you want to filter records that way. There are a few 'gotchas' which are explained on the CalPack2 documentation page.
With some knowledge of Javascript, you can make a number of customizations. For customization of functionality, see the documentation on the new Override Manager for details. For customization of display, see Customizing Calendar Display. For date formats used in Overrides, see Date Formatting.
Comments