Calendar#

The calendar component is a type of segment component that can be used to create, view and edit event objects in M-Files. The configuration for the calendar has 5 options:

  • Event Types: The main attraction of the Calendar, each EventType determines which objects should be displayed in the calendar as events.

  • Height: How much vertical space the calendar should take up in pixels.

  • Width: How wide the calendar should be in custom units.

  • Advanced Width: Extra width settings for responsive design.

  • Day max event rows: Controls how many events are allowed to be shown in any given timeslot before it collapses into a sub-menu.

  • Initial Date: Controls the date that the calendar starts on based on a property value in the metadata. For instance if you have a “Week” object portal that contains a number of hours, you can configure the calendar to start at the beginning of said week.

  • Default view mode: Controls whether to initially display the calendar in a Day, Week or Month view.

  • Days: Select which days of the week the calendar should display. You can select between ‘All’, ‘NoWeekends’ and ‘Custom’. If you select custom, you can define which days you want to display.

  • Business hours: Select the start and end times that the calendar can work with for each day. E.g. if you select Start at 8:00 am and end at 16:00 am, the Calendar cannot display or create dates outside that range.

  • Show when: A predicate defined by PortalRules used to determine when the calendar should be displayed in the Portal.

Event Type#

Event types are the representation that is required for CtrlPortals’ Calendar module to interact with M-Files objects, both for displaying them as events, and also for creating/editing them. Each event type is configured with 11 options:

  • Name: The name of the event type.

  • Object Type: The object type that this event type.

  • Class: The object class used for this event type.

  • From: A property definition for a DateTime property that determines when this event starts.

  • To: A property definition for a DateTime property that determines when this event ends.

  • All Day: A Boolean property determining if the event takes place for an entire day.

  • Cancelled: A Boolean property that indicates if an event is cancelled. If this is true, the title of the event will have a strike-through.

  • Hours: A number-property used to count how many hours this event takes up. This is used e.g. for reporting purposes.

  • Direct Relationship: A property that the event type uses to refer to the Portal’s subject-object.

  • Personal Relationship: The property that the event uses to point to the person if the event type is personal.

  • Background Color: A property that determines the background color of each event. Optional.

  • Text Color: A property that determines the text color of the event. Optional.

  • Background Event: Used to signify if the Event type should be shown as a background event, allowing other events to be stacked on top of it and disabling the context menu for the event.

  • No Collision: Determines if the event is not allowed to collide with other events of any type.

  • Event Title: Optional property that determines the title of the event as shown in the calendar. If this is not specified, the default ‘Name or Title’ is displayed. Note that it does not impact the actual name of the event, just how it appears in the calendar.

  • Event Hover: This placeholder is an optional text that is shown when hovering over an event with the mouse. HTML and multi-line values are supported. If this is not specified, the Event Title placeholder is displayed, and if that is not specified, the default ‘Name or Title’ is displayed.

  • To add a calendar, you would need to create one or more objects representing events and add the required properties to those objects.