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:

  • EventTypes: 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.

  • AdvancedWidth: Extra width settings for responsive design.

  • 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.

  • ObjType: The object type that this event type.

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

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

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

  • AllDay: 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.

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

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

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

  • PersonalType: Used to signify if the Event type should only be visible to the user who created the events.

  • PersonalRelationship: The property that the event uses to point to the person if the event type is personal. Be sure to set the ‘Personal Type’ according to the type of the property. If selecting from user accounts, the Personal Type should be UserAccount, otherwise EmployeeObject.

  • IsBackgroundEvent: 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.

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

  • EventTitle: 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.

  • EventHover: 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.