Skip to main content
Version: 5.28.0

Eventcalendar API

Here is a comprehensive list of all the options, events and method the Eventcalendar has.

Options

actionableEvents

boolean

Specifies if the events on the agenda and inside the calendar popover are actionable or not. If actionable, the event items will have hover and active states, and pointer cursor. Set to false when custom event rendering is used and the event list items contain other actionable elements, e.g. buttons.

Default value: true

clickToCreate

boolean | "double" | "single"

Enable new event creation on click. If true or 'double', a new event will be created only with a double click and with the 'single' value the event will be created instantly with a single click.

This option will only work on desktop environment where mouse events are fired. It will also allow deleting of the focused events using the Delete or Backspace key.

In touch environment a long tap should be used to create a new event and it is controlled by the dragToCreate option.

Using the extendDefaultEvent option extra properties can be set for the created event.

The event deletion functionality can be overwritten using the eventDelete option.

Default value: undefined

colors

Array<MbscCalendarColor>

Specifies the color for certain dates or date ranges on the calendar. The color object has the following properties:

  • allDay: boolean - Specifies whether the date you want to color is all day or not.
  • background: string - Background color of the cell, can be any valid CSS color ('red', '#ff0000', 'rgb(255, 0, 0)', etc.).
  • cellCssClass: string - CSS class for the day cell. Only applicable for the calendar view.
  • cssClass string - Specifies a custom CSS class for the color. Useful when customization is needed for the background of cells and time ranges. Only applicable for the timeline and scheduler views.
  • date: Date | string | object - Date of the calendar day which should be colored.
  • start: Date | string | object - Start of the colored range.
  • end: Date, string | object - End of the colored range.
  • highlight: string - Highlight color of the day, can be any valid CSS color ('red', '#ff0000', 'rgb(255, 0, 0)', etc.).
  • recurring: string | object - Recurrence rule for coloring recurring days.
  • recurringException: string | object | Array<string | object> - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule.
  • recurringExceptionRule: string | object - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule.
  • resource: string | number | Array<string | number> - Specifies the resource ids for the color. The color will be displayed only in the specified resource. If there is no resource defined, the color will be displayed in every resource.
  • slot: string | number - Specifies the slot id for the color. The color will be displayed only in the specified slot. If there is no slot defined, the color will be displayed in every slot.
  • textColor: string - Specifies the text color of the colored range title.
  • title: string - Text which will be displayed for the colored range. Only applicable for the timeline and scheduler views.
info

The colored range will be considered all-day if:

  • the allDay property is explicitly set.
  • the start / end properties are not specified, only the date.
info

The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects.

info

The colors can be combined with the labels or marked options.

colors: [
{ date: new Date(2020, 2, 23), background: 'pink' },
{ date: new Date(2020, 2, 24), background: 'green' },
{ background: '#ff0000', recurring: { repeat: 'weekly', weekDays: 'SU' } },
{ background: 'yellow', recurring: { repeat: 'weekly', weekDays: 'SA' } }
]

Default value: undefined

connections

Array<MbscEventConnection>

Specifies connections between events. On the UI events will be linked with lines and additionally arrows can be displayed to illustrate the direction of the connection. Events can have multiple connections simultaneously.

An array of connection objects can be passed. The connection object has the following properties:

  • arrow: boolean | 'from' | 'to' | 'bidirectional' - Specify where to display arrows. If true, the arrow will display only at the end side of the connection.
  • color: string - The color of the connection.
  • cssClass: string - Custom CSS class for the connection line for further customization.
  • from: string - The id of the event where the connection will begin.
  • to: string - The id of the event where the connection will end.
  • type: 'fs' | 'sf' | 'ss' | 'ff' - The type of the connection. Defaults to 'fs' Meaning of abbreviations: fs - finish-to-start, sf - start-to-finish, ss - start-to-start, ff - finish-to-finish.

Default value: undefined

cssClass

string

Specifies a custom CSS class for the component.

Default value: undefined

data

Array<MbscCalendarEvent>

The events for the calendar, as an array of event objects. The event object supports the following properties:

  • allDay: boolean - Specifies if the event is all day or not.
  • color: string - The color of the event.
  • cssClass string - Custom CSS class for the event. Useful when customization is needed on the event level. For example: setting the width for specific events.
  • dragBetweenResources: boolean - Specifies whether the event is movable across resources. It applies for scheduler and timeline views. Has precedence over the eventDragBetweenResources property of the resource and the dragBetweenResources option.
  • dragInTime: boolean - Specifies whether the event is movable in time. Has precedence over the eventDragInTime property of the resource and the dragInTime option.
  • editable: boolean - Specifies if an event is editable or not. Setting it to false disables drag & drop, resize and delete,
  • end: Date | string | object - The end of the event.
  • overlap: boolean - Specifies whether any overlap is allowed for the event. Has precedence over the eventOverlap property of the resource and the eventOverlap option.
  • id: string | number, Number - A unique id for the event. If not specified, the event will get a generated id. and the event will have the mbsc-readonly-event CSS class. With this class, the fixed events will be easily customizable, for example: add opacity or disable the cursor on the fixed events.
  • recurring: string | object - Recurrence rule for the event.
  • recurringException: string | object | Array<string | object> - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule.
  • recurringExceptionRule: string | object - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule.
  • resize: boolean - Specifies whether the event is resizable. Has precedence over the eventResize property of the resource and the dragToResize option.
  • resource: string | number | Array<string | number> - Specifies the resource ids for the event. The event will be displayed only in the specified resources. If there is no resource defined, the event will be displayed in every resource.
  • slot: string | number - Specifies the slot id for the event.
  • start: Date | string | object - The start of the event. The event will be displayed only in the specified slot. If there is no slot defined, the event will be displayed in every slot.
  • title: string - The title of the event.
  • tooltip: string - The tooltip text of the event.
info

The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects.

info

The event objects may have additional custom properties as well. The custom properties are not used by the event calendar, but they are kept and will be available anywhere the event objects are used. E.g. the onEventClick event will receive the event object as argument, containing the custom properties as well.

info

Use the getEvents method to get the events between two dates.

data: [
{
start: new Date(2021, 5, 23),
end: new Date(2021, 5, 30),
title: 'Conference',
allDay: true,
color: 'red'
},
{
title: 'Work project',
recurring: {
repeat: 'daily',
until: '2021-04-01'
},
recurringException: ['2021-03-15', '2021-03-25'],
recurringExceptionRule: {
repeat: 'weekly',
weekDays: 'SA,SU'
}
}
]

Default value: undefined

dataTimezone

string

The timezone in which the data is interpreted. If the data contains timezone information (when the ISO string has a timezone offset, e.g. "2021-03-28T01:00:00Z" or "2021-03-28T03:00:00+03:00") then the data's timezone is used instead.

info

When using timezones, the exclusiveEndDates option is also turned on by default.

info

When using anything other than the default ('local'), a timezone plugin must be also passed to the component.

Possible values:

  • 'local' - The system's local timezone.
  • 'utc' - UTC (Universal Coordinated Time) timezone.
  • Timezone name - The timezone name from the IANA time zone database, e.g. "America/New_York".

If not specified, it defaults to the displayTimezone.

Default value: undefined

defaultSelectedDate

MbscDateType

Specifies the initial selected date on the calendar.

Default value: undefined

displayTimezone

string

The timezone in which the data is displayed.

info

When using timezones, the exclusiveEndDates option is also turned on by default.

info

When using anything other than the default ('local'), a timezone plugin must be also passed to the component.

Possible values:

  • 'local' - The system's local timezone.
  • 'utc' - UTC (Universal Coordinated Time) timezone.
  • Timezone name - The timezone name from the IANA time zone database, e.g. "America/New_York".

Default value: 'local'

dragBetweenResources

boolean

If false, the events will not be moveable across resources, only in time. To control movement in time, use the dragInTime option.

Consider that dragToMove has to be enabled.

Default value: true

dragBetweenSlots

boolean

If false, the events will not be moveable across slots, only in time and resource. To control movement in time, use the dragInTime option.

Consider that dragToMove has to be enabled.

Default value: true

dragInTime

boolean

If false, the events will not be moveable in time. In case of the scheduler and timeline views events events can still be moved between resources. To control movement between resources, use the dragBetweenResources option.

Consider that dragToMove has to be enabled.

Default value: true

dragTimeStep

number

Specifies the steps in minutes for the scheduler and timeline events during drag.

Default value: 15

dragToCreate

boolean

If true, dragging on an empty cell will create a new event. It will also allow deleting of the focused events using the Delete or Backspace key.

The title of the new event can be specified with the newEventText option.

Using the extendDefaultEvent option extra properties can be set for the created event.

The event deletion functionality can be overwritten using the eventDelete option.

Default value: undefined

dragToMove

boolean

If true, the events will be moveable.

Default value: undefined

dragToResize

boolean

If true, the events will be resizable.

Default value: undefined

eventDelete

boolean

Enables or disables event deletion. When true, the focused event will be deleted on pressing the Delete or Backspace keys on the keyboard.

By default the event deletion depends on the clickToCreate and dragToCreate options. If either of those are true, and no eventDelete option is set, then event deletion is also enabled, otherwise not.

Default value: undefined

eventOrder

(event1: MbscCalendarEvent, event2: MbscCalendarEvent) => number

eventOverlap

boolean

If false, the events cannot overlap.

Default value: true

exclusiveEndDates

boolean

If true, the Eventcalendar will work in exclusive end dates mode, meaning that the last moment of the range (event, invalid, colors, etc.) is not part of the range.

E.g. end: '2021-07-03T00:00' means that the event ends on 2nd of July and will not be displayed on 3rd of July.

info

When using timezones, the exclusiveEndDates option will default to true.

extendDefaultEvent

(args: MbscNewEventData) => MbscCalendarEvent

externalDrag

boolean

If true, external drag & drop is allowed and events can be dragged outside of the component view.

Default value: undefined

externalDrop

boolean

If true, external events can be dragged into the view.

Default value: undefined

groupBy

"date" | "resource"

Groups the events by date or by resource.

Default value: 'resource'

height

string | number

Sets the height of the component.

The height of the calendar view impacts the number of labels that fit into a table cell. A "show more" label will be displayed for events that don't fit.

Default value: undefined

immutableData

boolean

If true, the Eventcalendar will work in immutable mode. In this mode the component won't update the data directly, only fire the necessary lifecycle events, where the original data can be updated manually.

Default value: undefined

invalid

Array<MbscDateType> | Array<IValidateProps>

An array containing the invalid values. Can contain dates, or objects with the following properties:

  • allDay: boolean - Specifies whether the invalid range is all day or not.
  • start: Date | string | object - Start of the invalid range.
  • end: Date, string | object - End of the invalid range.
  • recurring: string | object - Recurrence rule for recurring invalid ranges.
  • recurringException: string | object | Array<string | object> - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule.
  • recurringExceptionRule: string | object - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule.
  • resource: string | number | Array<string | number> - Specifies the resource ids for the invalid range. The invalid range will be displayed only in the specified resource. If there is no resource defined, the invalid range will be displayed in every resource.
  • slot: string | number - Specifies the slot id for the invalid range. The invalid range will be displayed only in the specified slot. If there is no slot defined, the invalid range will be displayed in every slot.
  • title: string - Text which will be displayed for the invalid range. Only applicable for the timeline and scheduler views.
info

The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects.

invalid: [
// Passing exact dates and times
new Date(2021, 1, 7), // Date object
'2021-10-15T12:00', // ISO 8601 string
moment('2020-12-25'), // moment object

// Passing invalid ranges
{
// ISO 8601 strings
start: '2021-10-15T12:00',
end: '2021-10-18T13:00',
title: 'Company 10th anniversary',
},
{
// Date objects
allDay: true,
start: new Date(2021, 2, 7),
end: new Date(2021, 2, 9),
title: 'Conference for the whole team',
},
{
// Time range with recurrence
start: '13:00',
end: '12:00',
recurring: { repeat: 'weekly', weekDays: 'MO,TU,WE,TH,FR' },
title: 'Lunch break',
},
{
// Disable weekends
recurring: {
repeat: 'weekly',
weekDays: 'SA,SU'
}
}
];

Default value: undefined

invalidateEvent

"start-end" | "strict"

Specifies how to validate events against invalid ranges on create/move/resize:

  • 'strict' - The event cannot intersect with an invalid range at all.
  • `'start-end' - The event start and end cannot be inside an invalid range.

Default value: 'strict'

labels

Array<MbscCalendarLabel>

Specifies labels for calendar days. A label object can have the following properties:

  • cellCssClass: string - CSS class for the day cell. Only applicable for the calendar view.
  • color: string - The color of the label, can be any valid CSS color ('red', '#ff0000', 'rgb(255, 0, 0)', etc.).
  • date: Date | string | object - Date of the calendar label for single day labels.
  • start: Date | string | object - Start of the calendar label.
  • end: Date, string | object - End of the calendar label.
  • text: string - The text of the label.
  • recurring: string | object - Recurrence rule for recurring labels.
  • recurringException: string | object | Array<string | object> - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule.
  • recurringExceptionRule: string | object - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule.
info

The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects.

info

The labels can be combined with the colors option.

labels: [
{
start: new Date(2020, 2, 23),
end: new Date(2020, 2, 24),
text: 'Conference',
color: 'red'
},
{
text: 'Christmas',
recurring: { repeat: 'yearly', month: 12, day: 24 }
}
]

Default value: undefined

marked

Array<MbscCalendarMarked>

Mark certain dates on the calendar. An array containing dates, or objects with the following properties:

  • cellCssClass: string - CSS class for the day cell. Only applicable for the calendar view.
  • color: string - The color of the mark, can be any valid CSS color ('red', '#ff0000', 'rgb(255, 0, 0)', etc.).
  • date: Date | string | object - ate of the day to be marked.
  • start: Date | string | object - Start date of the days to be marked.
  • end: Date, string | object - End date of the days to be marked.
  • markCssClass: string - CSS class for the mark.
  • recurring: string | object - Recurrence rule for recurring marked days.
  • recurringException: string | object | Array<string | object> - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule.
  • recurringExceptionRule: string | object - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule.
info

The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects.

info

The marked days can be combined with the colors option.

marked: [
new Date(2020, 2, 15),
new Date(2020, 2, 22),
{
start: new Date(2020, 2, 23),
end: new Date(2020, 2, 24),
color: 'red'
},
{
color: 'green',
recurring: { repeat: 'yearly', month: 12, day: 24 }
}
]

Default value: undefined

max

MbscDateType

Maximum date and time. The calendar cannot be navigated beyond the specified maximum date. If navigation is needed, but event creation should not be allowed after a specific date, use the invalid option with daily recurrence starting from the specific date.

Default value: undefined

min

MbscDateType

Minimum date and time. The calendar cannot be navigated beyond the specified minimum date. If navigation is needed, but event creation should not be allowed before a specific date, use the invalid option with daily recurrence until the specific date.

Default value: undefined

refDate

MbscDateType

Specifies the reference date of the component, which represents when to start to calculate the view you want to display. For example, if you want to display 14 days from today, you can specify today as the reference date.

info

If not defined, in case of scheduler and timeline views it will default to today, in other views it will default to '1970/01/01'.

Default value: undefined

resources

null | Array<MbscResource>

The scheduler and timeline views can handle multiple resources. Resource grouping can be modified with the help of the groupBy option.

If set to null or undefined, all events will be displayed, regardless of their resource property. If set to an empty array, only those events will be displayed which are not tied to any resource.

The timeline view can render multiple levels of hierarchy groups. Levels can be added with the help of the children property.

The resource object supports the following properties:

  • children: Array<MbscResource> - Children resources.
  • collapsed: boolean - The displayed state of the children resources.
  • id: Number, string - The id of the resource.
  • name: string - The name of the resource.
  • color: string - The color sets the default color for the events of the resource. If an event has an explicit color set, the resource color will be overridden. If the color is not set, the events of the resource will inherit the default calendar color.
  • eventCreation: boolean - Disable event creation on specific resources by setting it to false. It's true by default.
  • eventDragBetweenResources: boolean - Specifies whether the events in the specified resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the dragBetweenResources option.
  • eventDragInTime: boolean - Specifies whether the events in the specified resource are movable in time. Has precedence over the dragInTime option.
  • eventOverlap: boolean - Specifies whether any overlap is allowed for the events in the specified resource. Has precedence over the eventOverlap option.
  • eventResize: boolean - Specifies whether the events in the specified resource are resizable. Has precedence over the dragToResize option.
  • fixed: boolean - Specifies whether the resource is fixed to the top. It applies for timeline view if resolutionVertical in view option is not given, or it's value is set to none. Consider that the fixed resources always have to be the first elements of the array in a sequence (no non-fixed resources inserted in between) so that the drag&drop and event creation functionalities to work properly.
resources: [
{
id: 1,
name: 'Flatiron Room',
color: '#f7c4b4'
},
{
id: 2,
name: 'The Capital City',
color: '#c6f1c9'
},
{
id: 3,
name: 'Heroes Square',
color: '#e8d0ef'
}
]

Default value: undefined

responsive

missing

Specifies different options for different container widths, in a form of an object, where the keys are the name of the breakpoints, and the values are objects containing the options for the given breakpoint.

info

The available width is queried from the container element of the component and not the browsers viewport like in css media queries

There are five predefined breakpoints:

  • xsmall - min-width: 0px
  • small - min-width: 576px
  • medium - min-width: 768px
  • large - min-width: 992px
  • xlarge - min-width: 1200px

Custom breakpoints can be defined by passing an object containing the breakpoint property specifying the min-width in pixels. Example:

responsive: {
small: {
display: 'bottom'
},
custom: { // Custom breakpoint
breakpoint: 600,
display: 'center'
},
large: {
display: 'anchored'
}
}

Default value: undefined

selectMultipleEvents

boolean

When true, enables multiple event selection on the calendar.

Default value: false

selectedDate

MbscDateType

Specifies the selected date on the calendar. Setting this option will force the calendar to display the passed date and won't display anything else unless another selected date is set. This is called a controlled usage, and the onSelectedDateChange event can be used to get notified and act on navigational changes.

To set the initially displayed date without a controlled usage, use the defaultSelectedDate option instead.

Default value: undefined

selectedEvents

Array<MbscCalendarEvent>

Specifies the selected events on the calendar. The onSelectedEventsChange event will be fired when the selected events change from the calendar.

Default value: undefined

separator

string

Separator between date and time in the formatted date string.

Default value: ' '

showControls

boolean

Show or hide the calendar header controls: the previous and next buttons, and the current view button together with the year and month picker.

Default value: true

showEventTooltip

boolean

If false, it will hide the native tooltip that shows up when hovering over an event.

Default value: true

slots

null | Array<MbscSlot>

The slots besides the resources introduce a horizontal level of data grouping to the timeline view.

If set to null or undefined, all events will be displayed, regardless of their slot property. If set to an empty array, only those events will be displayed which are not tied to any slot.

The slot object supports the following properties:

  • id: string | number - The id of the slot.
  • name: string - The name of the slot.
slots: [
{
id: 1,
name: 'Morning shift',
},
{
id: 2,
name: 'Afternoon shift',
}
]

Default value: undefined

theme

string

Specifies the visual appearance of the component.

If it is 'auto' or undefined, the theme will automatically be chosen based on the platform. If custom themes are also present, they will take precedence over the built in themes, e.g. if there's an iOS based custom theme, it will be chosen on the iOS platform instead of the default iOS theme.

Supplied themes:

  • 'ios' - iOS theme
  • 'material' - Material theme
  • 'windows' - Windows theme

It's possible to modify theme colors or create custom themes.

info

Make sure that the theme you set is included in the downloaded package.

Default value: undefined

themeVariant

"dark" | "light" | "auto"

Controls which variant of the theme will be used (light or dark).

Possible values:

  • 'light' - Use the light variant of the theme.
  • 'dark' - Use the dark variant of the theme.
  • 'auto' or undefined - Detect the preferred system theme on devices where this is supported.

To use the option with custom themes, make sure to create two custom themes, where the dark version has the same name as the light one, suffixed with '-dark', e.g.: 'my-theme' and 'my-theme-dark'.

Default value: undefined

timezonePlugin

ITimezonePlugin

Specifies the timezone plugin, which can handle the timezone conversions.

By default the component uses the local timezone of the browser to interpret dates. If you want to interpret dates a different timezone, you will need an external library to handle the timezone conversions. There are two supported libraries: moment-timezone and luxon.

You can specify either the dataTimezone or the displayTimezone or both.

Depending on which external library you use you can pass either the momentTimezone or luxonTimezone objects. These objects can be imported from the mobiscroll bundle.

Default value: undefined

view

MbscEventcalendarView

Configures the Eventcalendar view. Possible views:

calendar: Configures the calendar view. Properties:

  • type: 'week' | 'month' | 'year' (default 'month') - Sets the calendar type.
  • size: number (default 1) - Specifies the number of displayed weeks or months.
  • count: boolean (default false) - If true, it will display the number of events on the days with events.
  • outerDays: boolean (default false) - Show or hide days from previous and next months. Does not apply to week view.
  • labels: boolean | number | 'all' (default true) - Enable displaying events as labels on calendar days.
    • If set to true, events will be displayed in the available space. If there are more events for a day, than the available space, a label with "more" text will be displayed, which opens a popover showing all the events for the given day. To fit more events on a day, set the calendar height to an appropriate value, using the height option.
    • If set to 'all', all the events will be displayed in the calendar cell and the row height will auto-expand based on the displayed events. The view will became scrollable if the rows overflow the available height.
    • Specify a number to set how many events will be displayed before the "more" button in a calendar cell. The row height will auto expand until the labels count reaches the given number and after that the "x more" button will be displayed. In the case when only one event should go in the "more" popup, that event will be displayed in the place of the "x more" button.
  • popover: boolean (default undefined) - Enable popover on days containing events. If not explicitly defined, the popover will not show up if an agenda view is also displayed. If event labels are displayed, the popover will only show up for days where the labels do not fit on the calendar, and a "more" label is present.
  • popoverClass: string (default undefined) - A custom CSS class added to the popover element. Can be used to customize the styling of the popover.
  • scroll: 'horizontal' | 'vertical' (default 'horizontal') - Specifies the direction of the calendar scroll.
  • weekNumbers: boolean (default false) - Show or hide week numbers.

agenda: Configures the agenda view. Properties:

  • type: 'day' | 'week' | 'month' | 'year' (default 'month') - Sets the agenda type. If calendar is also displayed, only 'month', 'week' and 'day' values are supported. In case of month and week, the type and size should match the calendar type and size. In case of day type events on the selected calendar day will be displayed, so size will always be 1.

  • size: number (default 1) - Specifies the number of displayed years, months, weeks or days.

  • scrollable: boolean (default true) - Setting this to true makes the agenda independently scrollable.

    info

    There are two prerequisites for making this work:

    1 - The calendar needs to be to placed inside a container which has a height. This can be either a fixed height, a height in percentage, or a flex height. When the calendar is placed directly in a container with a fixed height, it will work out of the box. If the height of the container is specified in percentage, e.g. you'd like to fill the full page height, you need to make sure that all parent elements also have 'height: 100%' specified, up until the body and html elements, or until the closest parent which has a fixed height. If the container is inside a parent with flex layout, it will also work out of the box.

    2 - The agenda needs a minimum height of 200px - the result of the container height minus the height of the calendar header minus the height of the displayed calendar rows. If the calculated height is less then 200px, the agenda will not be scrollable.

schedule: Configures the scheduler view. Properties:

  • type: 'day' | 'week' | 'month' (default 'week') - Sets the scheduler type.

  • size: number (default: 1)- Specifies the number of displayed months, weeks or days.

  • allDay: boolean (default true) - Show or hide the all day events.

  • currentTimeIndicator: boolean (default true) - Show or hide the current time indicator.

  • days: boolean (default true) - Show or hide week days above the scheduler grid.

  • startDay: number (default 0) - Set the first week day of the view: Friday is 5, Saturday is 6, etc.

  • endDay: number (default 6) - Set the last week day of the view: Sunday is 0, Monday is 1, etc.

  • startTime: string (default '00:00') - Set the start time of scheduler column. Hours and minutes can be specified in the same string, example: '09:30'.

  • endTime: string (default '24:00') - Set the end time of scheduler column. Hours and minutes can be specified in the same string, example: '18:30'.

  • timeCellStep: number (default 60) - Set the step of the grid cells in minutes. Supported values: 1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440.

  • timeLabelStep: number (default 60) - Set the step of the time labels in minutes. Supported values: 1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440.

  • timezones: Array<string | object> - Display times in multiple timezones on the time scale and time indicator. The timezones array can contain timezone strings or objects with timezone and label properties. Timezone strings must use the name from the IANA time zone database. If no label is provided, the time column label will be UTC +/- the timezone offset.

    timezones: ['Europe/Berlin','Europe/Bucharest']
    timezones: [
    { timezone: 'America/Chicago', label: 'CHI'},
    { timezone: 'America/New_York', label: 'NY'}
    ]

timeline: Configures the timeline view. Properties:

  • type: 'day' | 'week' | 'month' | 'year' (default 'week') - Sets the timeline type.
  • size: number (default: 1)- Specifies the number of displayed years, months, weeks or days.
  • resolutionHorizontal: 'hour', 'day', 'week', 'month', 'quarter', 'year' (default 'hour') - Sets the horizontal resolution of the timeline. In case of hourly resolution, the columns can be split to minutes (1, 5, 15, 20, 30) or merge to multiple hours (2, 3, 4, 6, 8, 12) using the timeCellStep and timeLabelStep properties.
  • currentTimeIndicator: boolean - Show or hide the current time indicator. Defaults to true, when the horizontal resolution is less than a day.
  • startDay: number (default 0) - Set the first week day of the view: Friday is 5, Saturday is 6, etc.
  • endDay: number (default 6) - Set the last week day of the view: Sunday is 0, Monday is 1, etc.
  • startTime: string (default '00:00') - Set the start time of the timeline days. Hours and minutes can be specified in the same string, example: '09:30'.
  • endTime: string (default '24:00') - Set the end time of the timeline days. Hours and minutes can be specified in the same string, example: '18:30'.
  • timeCellStep: number (default 60) - Set the step of the grid cells in minutes. Supported values: 1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440.
  • timeLabelStep: number (default 60) - Set the step of the time labels in minutes. Supported values: 1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440.
  • eventList: boolean (default false) - If true, transforms the layout into a summary view. The events are listed in the appropriate cell one after the other.
  • rowHeight: 'variable' | 'equal' (default 'variable') - Controls the height of the timeline rows. By default rows will have variable height and will expand to accommodate the displayed events. If it is set to 'equal', the rows will have equal heights.
  • virtualScroll: boolean (default true) - Enable or disable virtual scroll.
  • weekNumbers: boolean (default false) - Show or hide week numbers.
view: {
calendar: {
type: 'week',
size: 2
},
agenda: {
type: 'week',
size: 2
}
}

width

string | number

Sets the width of the component.

Default value: undefined

Events

@cell-click

(args: MbscCellClickEvent, inst: EventcalendarBase) => void

Triggered when a cell is clicked on the calendar day, scheduler cell, or timeline cell.

Parameters:

  • args - The event object has the following properties:

    • date: Date - The date of the clicked cell.
    • domEvent: Event - The DOM event of the click.
    • events: Array<MbscCalendarEvent> - The events for the clicked date.
    • resource: string | number - The id of the resource where the cell was clicked, if resources are set.
    • selected: boolean - Specifies if the day is currently selected or not (before it was clicked).
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the cell was clicked.
    • target: HTMLElement - The DOM element of the clicked cell.
  • inst - The component instance.

@cell-double-click

(args: MbscCellClickEvent, inst: EventcalendarBase) => void

Triggered when a cell is double-clicked on the calendar day, scheduler cell, or timeline cell.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date of the clicked cell.
    • domEvent: Event - The DOM event of the click.
    • events: Array<MbscCalendarEvent> - The events for the clicked date.
    • resource: string | number - The id of the resource where the cell was clicked, if resources are set.
    • selected: boolean - Specifies if the day is currently selected or not (before it was clicked).
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the cell was clicked.
    • target: HTMLElement - The DOM element of the clicked cell.
  • inst - The component instance.

@cell-hover-in

(args: MbscCellHoverEvent, inst: EventcalendarBase) => void

Triggered when the mouse pointer hovers a day on the calendar view (does not apply for agenda, schedule and timeline views).

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The selected date as a Date object.
    • events: Array<MbscCalendarEvent> - The events for the hovered day.
    • labels: Array<MbscCalendarLabel> - If the day has labels, contains the label objects for the hovered day.
    • marked: Array<MbscCalendarMarked> If the day is marked, contains the marked objects for the hovered day.
    • selected: boolean - - Specifies if the day is currently selected or not.
    • target: HTMLElement - The DOM element of the cell.
  • inst - The component instance.

@cell-hover-out

(args: MbscCellHoverEvent, inst: EventcalendarBase) => void

Triggered when the mouse pointer leaves a day on the calendar view (does not apply for agenda, schedule and timeline views).

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The selected date as a Date object.
    • events: Array<MbscCalendarEvent> - The events for the hovered day.
    • labels: Array<MbscCalendarLabel> - If the day has labels, contains the label objects for the hovered day.
    • marked: Array<MbscCalendarMarked> If the day is marked, contains the marked objects for the hovered day.
    • selected: boolean - Specifies if the day is currently selected or not.
    • target: HTMLElement - The DOM element of the cell.
  • inst - The component instance.

@cell-right-click

(args: MbscCellClickEvent, inst: EventcalendarBase) => void

Triggered when a cell is right-clicked on the calendar, scheduler, or timeline grid .

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date of the clicked cell.
    • domEvent: Event - The DOM event of the click.
    • events: Array<MbscCalendarEvent> - The events for the clicked date.
    • resource: string | number - The id of the resource where the cell was clicked, if resources are set.
    • selected: boolean - Specifies if the day is currently selected or not (before it was clicked).
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the cell was clicked.
    • target: HTMLElement - The DOM element of the clicked cell.
  • inst - The component instance.

@destroy

(args: any, inst: any) => void

Triggered when the component is destroyed.

Parameters:

  • args - The event argument object.

  • inst - The component instance.

@event-click

(args: MbscEventClickEvent, inst: EventcalendarBase) => void

Triggered when an event is clicked.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date on which the event was clicked.
    • domEvent: Event - The DOM event of the click.
    • event: MbscCalendarEvent - The clicked calendar event.
    • resource: string | number - The id of the resource where the event was clicked, if resources are set.
    • selected: boolean - Specifies if the day is currently selected or not (before it was clicked).
    • slot: string | number - The id of the slot where the event was clicker, if slots are set.
    • source: 'agenda' | 'calendar' | 'schedule' | 'timeline' | 'popover' - The view where the event was clicked.
  • inst - The component instance.

@event-create

(args: MbscEventCreateEvent, inst: EventcalendarBase) => void

Triggered when an event is about to create and it is not yet rendered on its final position. Event creation can be prevented by returning false from the handler function.

Parameters:

  • args - The event argument with the following properties:

    • action: 'click' | 'drag' | 'externalDrop' - The action which created the event.
    • domEvent: Event - The DOM event from the end of the gesture (mouseup or touchend).
    • event: MbscCalendarEvent - The newly created event.
    • originEvent: MbscCalendarEvent - The occurrence of the event which was dragged. Will be set only if the event was created by dragging a recurring event occurrence.
    • source: 'calendar' | 'timeline' | 'schedule' - The view where the event is being created.
  • inst - The component instance.

@event-create-failed

(args: MbscEventCreateFailedEvent, inst: EventcalendarBase) => void

Triggered when an event creation failed due to overlapping an invalid range or another event.

Parameters:

  • args - The event argument with the following properties:

    • action: 'click' | 'drag' | 'externalDrop' - The action which created the event.
    • event: MbscCalendarEvent - The newly created event.
    • invalid: object - The invalid object which the event overlapped.
    • overlap: MbscCalendarEvent - The overlapped event.
    • originEvent: MbscCalendarEvent - The occurrence of the event which was dragged. Will be set only if the event was created by dragging a recurring event occurrence.
    • source: 'calendar' | 'timeline' | 'schedule' - The view where the event was created.
  • inst - The component instance.

@event-created

(args: MbscEventCreatedEvent, inst: EventcalendarBase) => void

Triggered when an event is created and it is rendered in its position.

Parameters:

  • args - The event argument with the following properties:

    • action: 'click' | 'drag' | 'externalDrop' - The action which created the event.
    • event: MbscCalendarEvent - The newly created event.
    • source: 'calendar' | 'timeline' | 'schedule' - The view where the event was created.
    • target: HTMLElement - The DOM element of the created event.
  • inst - The component instance.

@event-delete

(args: MbscEventDeleteEvent, inst: EventcalendarBase) => void

Triggered when an event is about to be deleted and it is not yet removed from the view. Event deletion can be performed with delete and backspace button on an active event. Deletion can be prevented by returning false from the handler function.

Parameters:

  • args - The event argument with the following properties:

    • domEvent: Event - The DOM event from of the keydown action.
    • event: MbscCalendarEvent - The event being deleted.
    • events: Array<MbscCalendarEvent> - The events being deleted in case of multiple event selection.
    • source: 'agenda' | 'calendar' | 'timeline' | 'schedule' - The view where the event is being deleted.
  • inst - The component instance.

@event-deleted

(args: MbscEventDeletedEvent, inst: EventcalendarBase) => void

Triggered when an event is deleted and it is removed from the view.

Parameters:

  • args - The event argument with the following properties:

    • event: MbscCalendarEvent - The deleted event.
    • events: Array<MbscCalendarEvent> - The deleted events in case of multiple event selection.
    • source: 'agenda' | 'calendar' | 'timeline' | 'schedule' - The view where the event was deleted.
  • inst - The component instance.

@event-double-click

(args: MbscEventClickEvent, inst: EventcalendarBase) => void

Triggered when an event is double-clicked.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date on which the event was clicked.
    • domEvent: Event - The DOM event of the click.
    • event: MbscCalendarEvent - The clicked calendar event.
    • resource: string | number - The id of the resource where the event was clicked, if resources are set.
    • selected: boolean - Specifies if the day is currently selected or not (before it was clicked).
    • slot: string | number - The id of the slot where the event was clicker, if slots are set.
    • source: 'agenda' | 'calendar' | 'schedule' | 'timeline' | 'popover' - The view where the event was clicked.
  • inst - The component instance.

@event-drag-end

(args: MbscEventDragEvent, inst: EventcalendarBase) => void

Triggered when an event drag has ended.

Parameters:

  • args - The event argument with the following properties:

    • domEvent: Event - The DOM event of the drag.
    • event: MbscCalendarEvent - The dragged calendar event.
    • resource: string | number - The id of the resource where the event was dragged, if resources are set.
    • slot: string | number - The id of the slot where the event was dragged, if slots are set.
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the event was dragged.
  • inst - The component instance.

@event-drag-enter

(args: MbscEventDragEvent) => void

Triggered when an event is dragged into the calendar/timeline/schedule view.

Parameters:

  • args - The event argument with the following properties:
    • domEvent: Event - The DOM event of the drag.
    • event: MbscCalendarEvent - The dragged calendar event.
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the event is dragged.

@event-drag-leave

(args: MbscEventDragEvent) => void

Triggered when an event is dragged out form the calendar/timeline/schedule view.

Parameters:

  • args - The event argument with the following properties:
    • domEvent: Event - The DOM event of the drag.
    • event: MbscCalendarEvent - The dragged calendar event.
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the event is dragged.

@event-drag-start

(args: MbscEventDragEvent, inst: EventcalendarBase) => void

Triggered when an event drag has started.

Parameters:

  • args - The event argument with the following properties:

    • action: 'create' | 'resize' | 'move' - The user action which triggered the event.
    • domEvent: Event - The DOM event of the drag.
    • event: MbscCalendarEvent - The dragged calendar event.
    • resource: string | number - The id of the resource where the event is dragged, if resources are set.
    • slot: string | number - The id of the slot where the event is dragged, if slots are set.
    • source: 'calendar' | 'schedule' | 'timeline' - The view where the event is dragged.
  • inst - The component instance.

@event-hover-in

(args: MbscEventClickEvent, inst: EventcalendarBase) => void

Triggered when the mouse pointer hovers an event on the calendar.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date on which the event is hovered.
    • domEvent: Event - The DOM event of the hover.
    • event: MbscCalendarEvent - The hovered calendar event.
    • resource: string | number - The id of the resource where the event is hovered, if resources are set.
    • slot: string | number - The id of the slot where the event is hovered, if slots are set.
    • source: 'agenda' | 'calendar' | 'schedule' | 'timeline' | 'popover' - The view where the event is hovered.
  • inst - The component instance.

@event-hover-out

(args: MbscEventClickEvent, inst: EventcalendarBase) => void

Triggered when the mouse pointer leaves an event on the calendar.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date on which the event was hovered.
    • domEvent: Event - The DOM event of the hover.
    • event: MbscCalendarEvent - The hovered calendar event.
    • resource: string | number - The id of the resource where the event was hovered, if resources are set.
    • slot: string | number - The id of the slot where the event was hovered, if slots are set.
    • source: 'agenda' | 'calendar' | 'schedule' | 'timeline' | 'popover' - The view where the event was hovered.
  • inst - The component instance.

@event-right-click

(args: MbscEventClickEvent, inst: EventcalendarBase) => void

Triggered when an event is right-clicked.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date on which the event was clicked.
    • domEvent: Event - The DOM event of the click.
    • event: MbscCalendarEvent - The clicked calendar event.
    • resource: string | number - The id of the resource where the event was clicked, if resources are set.
    • selected: boolean - Specifies if the day is currently selected or not (before it was clicked).
    • slot: string | number - The id of the slot where the event was clicker, if slots are set.
    • source: 'agenda' | 'calendar' | 'schedule' | 'timeline' | 'popover' - The view where the event was clicked.
  • inst - The component instance.

@event-update

(args: MbscEventUpdateEvent, inst: EventcalendarBase) => void

Triggered when an event is about to update. Update can be prevented by returning false from the handler function.

Parameters:

  • args - The event argument with the following properties:

    • domEvent: Event - The DOM event from the end of the gesture (mouseup or touchend).
    • event: MbscCalendarEvent - The updated event.
    • events: Array<MbscCalendarEvent> - The updated events. It is set on recurring event delete, when multiple event selection is enabled.
    • newEvent: MbscCalendarEvent - The newly created event. Will be set only if the dragged event was a recurring event occurrence.
    • oldEvent: MbscCalendarEvent - The original event before the update.
    • oldEvents: Array<MbscCalendarEvent> - The original events before the update. It is set on recurring event delete, when multiple event selection is enabled.
    • oldEventOccurrence: MbscCalendarEvent - The occurrence of the event which was dragged. Will be set only if the dragged event was a recurring event occurrence.
    • source: 'calendar' | 'timeline' | 'schedule' - The view where the event is being updated.
  • inst - The component instance.

@event-update-failed

(args: MbscEventUpdateFailedEvent, inst: EventcalendarBase) => void

Triggered when an event update failed due to overlapping an invalid range or another event.

Parameters:

  • args - The event argument with the following properties:

    • event: MbscCalendarEvent - The updated event.
    • invalid: object - The invalid object which the event overlapped.
    • overlap: MbscCalendarEvent - The overlapped event.
    • newEvent: MbscCalendarEvent - The newly created event. Will be set only if the dragged event was a recurring event occurrence.
    • oldEvent: MbscCalendarEvent - The original event before the update.
    • oldEventOccurrence: MbscCalendarEvent - The occurrence of the event which was dragged. Will be set only if the dragged event was a recurring event occurrence.
    • source: 'calendar' | 'timeline' | 'schedule' - The view where the event was updated.
  • inst - The component instance.

@event-updated

(args: MbscEventUpdatedEvent, inst: EventcalendarBase) => void

Triggered when an event is updated and is rendered in its new position. This is where you update the event in your database or persistent storage.

Parameters:

  • args - The event argument with the following properties:

    • event: MbscCalendarEvent - The updated event.
    • events: Array<MbscCalendarEvent> - The updated events. It is set on recurring event delete, when multiple event selection is enabled.
    • oldEvent: MbscCalendarEvent - The original event before the update.
    • oldEvents: Array<MbscCalendarEvent> - The original events before the update. It is set on recurring event delete, when multiple event selection is enabled.
    • source: 'calendar' | 'timeline' | 'schedule' - The view where the event was updated.
    • target: HTMLElement - The DOM element of the updated event.
  • inst - The component instance.

@init

(args: any, inst: any) => void

Triggered when the component is initialized.

Parameters:

  • args - The event argument object.

  • inst - The component instance.

@label-click

(args: MbscLabelClickEvent, inst: EventcalendarBase) => void

Triggered when a label is clicked on the calendar.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The date of the day on which the label was clicked.
    • domEvent: Event - The DOM event of the click.
    • label: MbscCalendarLabel - The original object of the label which was clicked, undefined in case of the "more" label.
    • labels: Array<MbscCalendarLabel> - An array containing each label object for the given day.
    • target: HTMLElement - The DOM element of the label.
  • inst - The component instance.

@page-change

(args: MbscPageChangeEvent, inst: EventcalendarBase) => void

Triggered when the calendar page is changed (with buttons or swipe).

Parameters:

  • args - The event argument with the following properties:

    • firstDay: Date - The first day of the displayed page.
    • lastDay: Date - The last day of the displayed page.
    • month: Date - The first day of the visible month in case of month view.
  • inst - The component instance.

@page-loaded

(args: MbscPageLoadedEvent, inst: EventcalendarBase) => void

Triggered when the calendar page is changed (with buttons or swipe) and the view finished rendering.

Parameters:

  • args - The event argument with the following properties:

    • firstDay: Date - The first day of the displayed page.
    • lastDay: Date - The last day of the displayed page.
    • month: Date - The first day of the visible month in case of month view.
  • inst - The component instance.

@page-loading

(args: MbscPageLoadingEvent, inst: EventcalendarBase) => void

Triggered before the markup of a calendar page is starting to render.

Parameters:

  • args - The event argument with the following properties:

    • firstDay: Date - The first day of the displayed page.
    • lastDay: Date - The last day of the displayed page.
    • month: Date - The first day of the visible month in case of month view.
  • inst - The component instance.

@resource-collapse

(args: MbscResourceCollapseEvent, inst: EventcalendarBase) => void

Triggered when a parent resource is collapsed on the timeline.

Parameters:

  • args - The event argument with the following properties:

    • domEvent: Event - The DOM event of the click.
    • resource: string | number - The id of the collapsed resource.
  • inst - The component instance.

@resource-expand

(args: MbscResourceExpandEvent, inst: EventcalendarBase) => void

Triggered when a parent resource is expanded on the timeline.

Parameters:

  • args - The event argument with the following properties:

    • domEvent: Event - The DOM event of the click.
    • resource: string | number - The id of the expanded resource.
  • inst - The component instance.

@selected-date-change

(args: MbscSelectedDateChangeEvent, inst: EventcalendarBase) => void

Triggered when the selected date is changed from the UI. You can use this event in conjunction with the selectedDate option to customize where the Eventcalendar should navigate.

Parameters:

  • args - The event argument with the following properties:

    • date: Date - The newly selected date.
  • inst - The component instance.

@selected-events-change

(args: MbscSelectedEventsChangeEvent, inst: EventcalendarBase) => void

Triggered when an event is selected or deselected on the UI, when multiple event selection is enabled.

You can also select events programmatically using the selectedEvents option.

Parameters:

  • args - The event argument with the following properties:

    • events: Array<MbscCalendarEvent> - The selected events.
  • inst - The component instance.

Localization

allDayText

string

Text for all day events.

Default value: 'All-day'

amText

string

Text for AM.

Default value: 'am'

calendarSystem

MbscCalendarSystem

Specifies the calendar system to be used. Supported calendars:

  • Gregorian - Gregorian calendar. This is the default calendar system.
  • Jalali - Persian calendar. The Farsi language needs to be included to the package.
  • Hijri - Hijri calendar. The Arabic language needs to be included to the package

Default value: undefined

dateFormat

string

The format for parsed and displayed dates:

  • M - month of year (no leading zero)
  • MM - month of year (two digit)
  • MMM - month name short
  • MMMM - month name long
  • D - day of month (no leading zero)
  • DD - day of month (two digit)
  • DDD - day of week (short)
  • DDDD - day of week (long)
  • YY - year (two digit)
  • YYYY - year (four digit)
  • '...' - literal text
  • '' - single quote
  • anything else - literal text

Default value: 'MM/DD/YYYY'

dateFormatFull

string

Human readable date format, used by screen readers to read out full dates. Characters have the same meaning as in the dateFormat option.

Default value: 'DDDD, MMMM D, YYYY'

dateFormatLong

string

Long date format, used by the agenda view and timeline day headers. Characters have the same meaning as in the dateFormat option.

Default value: 'D DDD MMM YYYY'

dayNames

Array<string>

The list of long day names, starting from Sunday.

Default value: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']

dayNamesMin

Array<string>

The list of minimal day names, starting from Sunday.

Default value: ['S', 'M', 'T', 'W', 'T', 'F', 'S']

dayNamesShort

Array<string>

The list of abbreviated day names, starting from Sunday.

Default value: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']

eventText

string

Text for the event word.

Default value: 'event'

eventsText

string

Text for the events word (plural).

Default value: 'events'

firstDay

number

Set the first day of the week: Sunday is 0, Monday is 1, etc.

Default value: 0

locale

string | MbscLocale

Sets the language of the component. The locale object contains all the translations for a given language. The built in language modules are listed below. If a language is not listed, it can be provided as a custom language module.

Supported values:

  • Arabic: localeAr, 'ar'
  • Bulgarian: localeBg, 'bg'
  • Catalan: localeCa, 'ca'
  • Czech: localeCs, 'cs'
  • Chinese: localeZh, 'zh'
  • Croatian: localeHr, 'hr'
  • Danish: localeDa, 'da'
  • Dutch: localeNl, 'nl'
  • English: localeEn or undefined, 'en'
  • English (UK): localeEnGB, 'en-GB'
  • Farsi: localeFa, 'fa'
  • German: localeDe, 'de'
  • Greek: localeEl, 'el'
  • Spanish: localeEs, 'es'
  • Finnish: localeFi, 'fi'
  • French: localeFr, 'fr'
  • Hebrew: localeHe, 'he'
  • Hindi: localeHi, 'hi'
  • Hungarian: localeHu, 'hu'
  • Italian: localeIt, 'it'
  • Japanese: localeJa, 'ja'
  • Korean: localeKo, 'ko'
  • Lithuanian: localeLt, 'lt'
  • Norwegian: localeNo, 'no'
  • Polish: localePl, 'pl'
  • Portuguese (Brazilian): localePtBR, 'pt-BR'
  • Portuguese (European): localePtPT, 'pt-PT'
  • Romanian: localeRo, 'ro'
  • Russian: localeRu, 'ru'
  • Russian (UA): localeRuUA, 'ru-UA'
  • Slovak: localeSk, 'sk'
  • Serbian: localeSr, 'sr'
  • Swedish: localeSv, 'sv'
  • Thai: localeTh, 'th'
  • Turkish: localeTr, 'tr'
  • Ukrainian: localeUa, 'ua'

Default value: undefined

monthNames

Array<string>

The list of full month names.

Default value: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']

monthNamesShort

Array<string>

The list of abbreviated month names.

Default value: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

moreEventsPluralText

string

Text for the "more" label on the calendar, when there's not enough space to display all the labels for the day, and there are more than one extra labels. The {count} inside the string will be replaced with the number of extra labels. When not specified, the moreEventsText option will be used for both plural and singular form.

Default value: undefined

moreEventsText

string

Text for the "more" label on the calendar, when there's not enough space to display all the labels for the day. The {count} inside the string will be replaced with the number of extra labels. Use the moreEventsPluralText as well, if the plural form is different.

Default value: '{count} more'

newEventText

string

Title for the newly created event with the dragToCreate and the clickToCreate action.

Default value: 'New event'

nextPageText

string

Text for the next button in the calendar header, used as accessibility label.

Default value: 'Next page'

noEventsText

string

Text for empty event list.

Default value: 'No events'

pmText

string

Text for PM.

Default value: 'pm'

prevPageText

string

Text for the previous button in the calendar header, used as accessibility label.

Default value: 'Previous page'

quarterText

string

Text for quarter numbers in the timeline header. The {count} inside the string will be replaced with the number of the current quarter.

Default value: 'Q {count}'

rtl

boolean

Enables right-to-left display.

Default value: false

timeFormat

string

The format for parsed and displayed times:

  • h - 12 hour format (no leading zero)
  • hh - 12 hour format (leading zero)
  • H - 24 hour format (no leading zero)
  • HH - 24 hour format (leading zero)
  • m - minutes (no leading zero)
  • mm - minutes (leading zero)
  • s - seconds (no leading zero)
  • ss - seconds (leading zero)
  • a - lowercase am/pm
  • A - uppercase AM/PM
  • '...' - literal text
  • '' - single quote
  • anything else - literal text

Default value: 'hh:mm A'

todayText

string

Text for the "Today" button.

Default value: 'Today'

weekText

string

Text for week numbers in the timeline header. The {count} inside the string will be replaced with the number of the current week.

Default value: 'Week {count}'

Methods

getEvents

(start: MbscDateType, end: MbscDateType) => Array<MbscCalendarEvent>

Returns the events between two dates. If start and end are not specified, it defaults to the start and end days of the current view. If end is not specified, it defaults to start date + 1 day.

getInvalids

(start: MbscDateType, end: MbscDateType) => Array<MbscCalendarEvent>

Returns the invalids between two dates. If start and end are not specified, it defaults to the start and end days of the current view. If end is not specified, it defaults to start date + 1 day.

navigate

(date: MbscDateType, animate: boolean) => void

Navigates to the specified date on the calendar.

navigateToEvent

(event: MbscCalendarEvent) => void

Navigates to the specified event on the calendar.

Slots

agenda

<template #agenda="{ events, options, dayRefs }">...</template>

Customize the agenda listing.

Available parameters:

  • events: Array<MbscEventList> - The events of the current view, grouped by day. A day object has the following properties:
    • date: string - The formatted date of the day.
    • events: Array<MbscCalendarEventData> - The list of events for the day. An event object has the following properties:
      • allDay: string - The localized all-day text in case of all day events.
      • end: string - The formatted end time, if the event is not all day.
      • id: string - The id of the event.
      • isMultiDay: boolean - True if the event spans across multiple days.
      • lastDay: boolean - True if it's rendered on the last day of a multiple event.
      • original: MbscCalendarEvent - The original event object.
      • start: string - The formatted start time, if the event is not all day.
      • title: string - The title of the event.
    • timestamp: number - The timestamp of the day.
  • options: MbscEventcalendarOptions - The current options of the component.
  • dayRefs: { [key: string]: HTMLElement | null } - An object holding the references to the DOM elements of the days containing the event lists. Needed for the scroll functionality: clicking on a calendar date scrolls to the date on the list as well, and scrolling the list updates the selected date on the calendar.

agendaEmpty

<template #agendaEmpty>...</template>

Customize the agenda listing when the list is empty.

day

<template #day="args">...</template>

Customize the day cells of the calendar view and the date header in case of scheduler and timeline views.

If you are looking to customize only the day cells content and don't want to bother with the styling of the event, in case of calendar and scheduler views you can use the dayContent option.

The following day specific details are available:

  • date: Date - The date of the rendered day.
  • selected: boolean - True if the date is selected (in case of the calendar view).
  • events: Array<MbscCalendarEvent> - The list of events for the day.
  • resource: string | number - The id of the resource in case of the scheduler (week and month views) when the events are grouped by resources.
  • isActive: boolean - True for the current day (in case of the timeline view).

dayContent

<template #dayContent="args">...</template>

Customize the day cells content of the event calendar. The Eventcalendar will take care of the styling and you can focus on what you show beside the day number.

If you are looking to fully customize the day (e.g. add custom hover effects) you will need to use the day option.

The following properties are available:

  • date: Date - The date of the rendered day.
  • selected: boolean - True if the date is selected (in case of the calendar view).
  • events: Array<MbscCalendarEvent> - The list of events for the day.
  • resource: string | number - The id of the resource in case of the scheduler (week and month views) when the events are grouped by resources.

dayFooter

<template #dayFooter="args">...</template>

Customize the footer of each day for the timeline.

The following day specific details are available:

  • date: Date - The date of the day.
  • events: Array<MbscCalendarEvent> - The list of events for the day.

event

<template #event="data">...</template>

Customize the events that appear on the agenda and the popover.

If you are looking to customize only the content (e.g. add custom elements) and don't want to bother with the styling of the event, you can use the eventContent option.

Some of the event specific details are computed, but there is also a reference to the original event they come from. The following event specific properties are available:

  • allDay: string - The localized all-day text in case of all day events.
  • end: string - The formatted end time, if the event is not all day.
  • id: string - The id of the event.
  • isMultiDay: boolean - True if the event spans across multiple days.
  • lastDay: boolean - True if it's rendered on the last day of a multiple event.
  • original: MbscCalendarEvent - The original event object.
  • start: string - The formatted start time, if the event is not all day.
  • title: string - The title of the event.

eventContent

<template #eventContent="data">...</template>

Customize the event content that appears on the agenda and the popover. The Eventcalendar will take care of styling and you can focus on what you show inside of the event.

If you are looking to fully customize the event (e.g. add custom hover effects) you will need to use the event option.

Some of the event specific details are computed, but there is also a reference to the original event they come from. The following event specific properties are available:

  • allDay: string - The localized all-day text in case of all day events.
  • end: string - The formatted end time, if the event is not all day.
  • id: string - The id of the event.
  • isMultiDay: boolean - True if the event spans across multiple days.
  • lastDay: boolean - True if it's rendered on the last day of a multiple event.
  • original: MbscCalendarEvent - The original event object. Any custom property on the event can be accessed through this property.
  • start: string - The formatted start time, if the event is not all day.
  • title: string - The title of the event.

header

<template #header>...</template>

Customize the header of the event calendar. You can use custom markup and the built in header components of the calendar.

hour

<template #hour="args">...</template>

Customize the header of the hour columns on the timeline view.

The following properties are available:

  • date: Date - The date and time of the rendered hour.
  • events: Array<MbscCalendarEvent> - The list of events for the hour.
  • isActive: boolean - True for the current hour.

hourFooter

<template #hourFooter="args">...</template>

Customize the footer of the hour columns on the timeline view.

The following properties are available:

  • date: Date - The date and time of the rendered hour.
  • events: Array<MbscCalendarEvent> - The list of events for the hour.

label

<template #label="event">...</template>

Customize the labels that appear on the calendar view. The Eventcalendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you.

If you are looking to customize only the content (e.g. add custom elements) and don't want to bother with the styling of the label, you can use the labelContent option.

Some of the event specific details are computed, but there is also a reference to the original event they come from. The following event specific properties are available:

  • end: string - The formatted end time, if the event is not all day.
  • id: string - The id of the event.
  • isMultiDay: boolean - True if the event spans across multiple days.
  • original: MbscCalendarEvent - The original event object. Any custom property on the event can be accessed through this property.
  • start: string - The formatted start time, if the event is not all day.

labelContent

<template #labelContent="event">...</template>

Customize the label contents, that appears on the calendar. The Eventcalendar will take care of styling and you can focus on what you show inside of the label a.k.a the content.

If you are looking to fully customize the label (ex. add custom hover effects) you will need to use the label option. In that case you will only get the positioning done by the Eventcalendar and everything else is up to you.

Some of the event specific details are computed, but there is also a reference to the original event they come from. The following event specific properties are available:

  • end: string - The formatted end time, if the event is not all day.
  • id: string - The id of the event.
  • isMultiDay: boolean - True if the event spans across multiple days.
  • original: MbscCalendarEvent - The original event object. Any custom property on the event can be accessed through this property.
  • start: string - The formatted start time, if the event is not all day.

month

<template #month="args">...</template>

Customize the header of the month column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered month.
  • events: Array<MbscCalendarEvent> - The list of events for the month.
  • isActive: boolean - True for the current month.

monthFooter

<template #monthFooter="args">...</template>

Customize the footer of the month column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered month.
  • events: Array<MbscCalendarEvent> - The list of events for the month.
  • isActive: boolean - True for the current month.

quarter

<template #quarter="args">...</template>

Customize the header of the quarter columns on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered quarter.
  • events: Array<MbscCalendarEvent> - The list of events for the quarter.
  • isActive: boolean - True for the current quarter.

quarterFooter

<template #quarterFooter="args">...</template>

Customize the footer of the quarter column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered quarter.
  • events: Array<MbscCalendarEvent> - The list of events for the quarter.
  • isActive: boolean - True for the current quarter.

resource

<template #resource="resource">...</template>

Customize how the resources are rendered on the scheduler and timeline views. The object of the rendered resource is available for use.

resourceFooter

<template #resourceFooter>...</template>

Customize the cell content below the resource column on the timeline view, when the dayFooter option is also used.

resourceHeader

<template #resourceHeader>...</template>

Customize the cell content above the resource column on the timeline view.

scheduleEvent

<template #scheduleEvent="event">...</template>

Customize the events that appear on the scheduler and timeline. The Eventcalendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you.

If you are looking to customize only the content (e.g. add custom elements) and don't want to bother with the styling of the event, you can use the scheduleEventContent option.

Some of the event specific details are computed, but there is also a reference to the original event they come from. The following event specific properties are available:

  • allDay: string - The localized all-day text in case of all day events.
  • end: string - The formatted end time, if the event is not all day.
  • id: string - The id of the event.
  • isMultiDay: boolean - True if the event spans across multiple days.
  • lastDay: boolean - True if it's rendered on the last day of a multiple event.
  • original: MbscCalendarEvent - The original event object.
  • start: string - The formatted start time, if the event is not all day.
  • title: string - The title of the event.
  • currentResource: string | number - The resource of the row or column where the event is being rendered.

scheduleEventContent

<template #scheduleEventContent="event">...</template>

Customize the event content that appears on the scheduler and timeline. The Eventcalendar will take care of styling and you can focus on what you show inside of the event.

If you are looking to fully customize the event (e.g. add custom hover effects) you will need to use the scheduleEvent option. In that case you will only get the positioning done by the Eventcalendar and everything else is up to you.

Some of the event specific details are computed, but there is also a reference to the original event they come from. The following event specific properties are available:

  • allDay: string - The localized all-day text in case of all day events.
  • end: string - The formatted end time, if the event is not all day.
  • id: string - The id of the event.
  • isMultiDay: boolean - True if the event spans across multiple days.
  • lastDay: boolean - True if it's rendered on the last day of a multiple event.
  • original: MbscCalendarEvent - The original event object.
  • start: string - The formatted start time, if the event is not all day.
  • title: string - The title of the event.
  • currentResource: string | number - The resource of the row or column where the event is being rendered.

sidebar

<template #sidebar="resource">...</template>

Add a custom sidebar on the right side of the timeline. The object of the rendered resource is available for use.

sidebarFooter

<template #sidebarFooter>...</template>

Customize the cell content below the sidebar column on the timeline view, when the sidebar option is also used.

sidebarHeader

<template #sidebarHeader>...</template>

Customize the cell content above the sidebar column on the timeline view, when the sidebar option is also used.

slot

<template #slot="args">...</template>

Customize the slots template of the timeline view.

The following properties are available:

  • date: Date - The specific date where the slot is rendered.
  • slot: MbscSlot - The object of the rendered slot.

week

<template #week="args">...</template>

Customize the header of the week column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered week.
  • events: Array<MbscCalendarEvent> - The list of events for the week.
  • isActive: boolean - True for the current week.
  • endDate: Date - The end date of the week.
  • startDate: Date - The start date of the week.
  • weekNr: number - The week number. Enumeration starts with the first week of the year.

weekFooter

<template #weekFooter="args">...</template>

Customize the footer of the week column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered week.
  • events: Array<MbscCalendarEvent> - The list of events for the week.
  • isActive: boolean - True for the current week.
  • endDate: Date - The end date of the week.
  • startDate: Date - The start date of the week.
  • weekNr: number - The week number. Enumeration starts with the first week of the year.

year

<template #year="args">...</template>

Customize the header of the year column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered year.
  • events: Array<MbscCalendarEvent> - The list of events for the year.
  • isActive: boolean - True for the current year.

yearFooter

<template #yearFooter="args">...</template>

Customize the footer of the year column on the timeline view.

The following properties are available:

  • date: Date - First day of the rendered year.
  • events: Array<MbscCalendarEvent> - The list of events for the year.
  • isActive: boolean - True for the current year.