# Mobiscroll for Vue — Full Documentation > Complete Mobiscroll Vue documentation including Eventcalendar, Datepicker, Select, Popup, Forms, theming, and guides. This file contains all documentation content in a single document following the llmstxt.org standard. ## Getting started with Mobiscroll for Vue ## Install the CLI The first step you need to install the Mobiscroll library into your app is to install the Mobiscroll CLI. Install the Mobiscroll CLI from NPM (you'll only have to do it once). ```bash npm install -g @mobiscroll/cli ``` :::info On Windows client computers, the execution of PowerShell scripts is disabled by default. When using Powershell, to be able to install the Mobiscroll CLI you will need to set the following execution policy: ``` Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned ``` Make sure to read the message displayed after executing the command and follow the instructions. ::: ## Starting with the trial Start a free trial by entering your email address on the [Mobiscroll homepage](https://mobiscroll.com) and create your account. When asked, enter your first name, set a password and you're ready to go! ### This is how the free trial works: 1. You can try Mobiscroll for free. 2. The trial needs an active connection to Mobiscroll servers for validation. Don't worry, the licensed product will work offline with downloadable resource files. Read about the [differences between trial and licensed products](http://help.mobiscroll.com/trials/what-are-the-limitations-of-the-trial). 3. You can upgrade to the licensed product at any time during or after your trial. ### Installing a trial package To install the Mobiscroll Trial, you will need to open a terminal window in the root folder of you project and run the following command: ```bash mobiscroll config vue --trial ``` :::caution The CLI handles everything — don't do these manually - **Do not run `npm login`** — `mobiscroll config` sets up Mobiscroll's private NPM registry authentication automatically. - **Do not run `npm install @mobiscroll/...`** — the CLI adds and installs the Mobiscroll package for you. - **Do not set up a license key manually** — the CLI configures your license when you run `mobiscroll config`. ::: ## Installing from NPM To install the Mobiscroll library from NPM, you will need to open a terminal window in the root folder of you project and run the following command: ```bash mobiscroll config vue ``` :::caution The CLI handles everything — don't do these manually - **Do not run `npm login`** — `mobiscroll config` sets up Mobiscroll's private NPM registry authentication automatically. - **Do not run `npm install @mobiscroll/...`** — the CLI adds and installs the Mobiscroll package for you. - **Do not set up a license key manually** — the CLI configures your license when you run `mobiscroll config`. ::: :::info If you're working behind a proxy, additional configuration might be needed. Please check the [proxy configuration options](https://mobiscroll.com/docs/core-concepts/cli#using-the-cli-behind-a-proxy) of the CLI. ::: ## Setting up for CI/CD The config command will create a file named `.npmrc` in the project root, containing the access tokens to the Mobiscroll NPM registry. Commit this file into the repository to ensure the package will install for other team members and in CI/CD environments. When used with Yarn 2 or 3, a different file is used, named `.yarnrc.yml`. Make sure this is also added to the repository. When used with Docker, make sure to copy the `.npmrc` or `.yarnrc.yml` file together with `package.json`, to make sure that the install process will have access to the Mobiscroll NPM registry. Here's a Dockerfile example: ```bash FROM node:18.12.0 as build ENV NODE_ENV production WORKDIR /app COPY package.json package-lock.json .npmrc ./ RUN npm install COPY . . # ... ``` :::info It is recommended to set up and use [team NPM accounts](http://help.mobiscroll.com/en/articles/8095168-team-npm-accounts) instead of individual developer credentials for installing Mobiscroll. ::: ## Installing manually On the [download page](https://download.mobiscroll.com/) a custom package can be built by picking only the components, themes, languages and additional modules you need. When [building your package](http://help.mobiscroll.com/en/articles/974201-download-builder), select the required components and other resources, then hit the download button. **1. Copy Mobiscroll into your app** Extract the zip file you just downloaded, then grab the `js`, `src` and `css` folders and copy it into src/lib/mobiscroll folder of your JavaScript app. If there is no such folder available, you can create it. **2. Run the config command** Run the config command in the root folder of your app in a terminal window. ```bash mobiscroll config vue --no-npm ``` ## Use the components For the components to work, you will also need to import the css file of the installed library under the node_modules folder (at @mobiscroll/vue/dist/css/mobiscroll.min.css). If you are [using SCSS](https://sass-lang.com/), you will also find a full and a modular `.scss` file in the same directory. To test the installation, create a single file component (SFC), import the Eventcalendar component in it. You can also pass it a view option and/or set a specific theme if you want. In case you installed the library from a downloaded package and did not include the Eventcalendar in the package, you can choose a different component as well. ```html ``` --- ## Mobiscroll for Vue # Mobiscroll for Vue Mobiscroll has official support for the Vue 3 library. Mobiscroll for Vue ships native Vue components. It shares a common core with the other supported frameworks and libraries, but uses Vue's rendering and reactivity model for a perfect fit in a Vue application. :::info Supported versions Mobiscroll supports Vue version 3 or newer. ::: :::info Supported platforms Android 5+ including Android 16, iOS 13+ including iOS 26 and all major desktop browsers, including Chrome 56+, Firefox 32+, Safari 13+ and Edge 79+. ::: ## Introduction The following sections help you get started and learn more on the Mobiscroll library. ## UI Components Delve right into how the individual components work and learn about their API by following the links below. --- ## Using Mobiscroll with Ionic # Using Mobiscroll with Ionic Installing Mobiscroll in your Ionic app takes a couple of minutes. Let's see how you can start with the tabs starter app. ## Using the Mobiscroll CLI and NPM ### Step 1: Create an app Assuming you have node and ionic already installed (if not, you can read about it in [the Ionic docs](https://ionicframework.com/#cli)), use the CLI to create a new app. If you already have an app at hand, you can skip this step. :::info Note that it could take a couple of minutes until the app is created (depending on your internet connection and machine performance). ::: ```bash ionic start myStarterApp tabs --type=vue ``` ```bash cd myStarterApp ``` ### Step 2: Install the Mobiscroll CLI Install Mobiscroll CLI from NPM. You'll only have to do this step once on a single development machine. You won't need to repeat this on other machines or production servers. ```bash $ npm install -g @mobiscroll/cli ``` ### Step 3: Configure the project using the CLI To install the Mobiscroll library from NPM, you will need to open a terminal window in the root folder of you project and run the following command: ```bash mobiscroll config vue ``` :::caution The CLI handles everything — don't do these manually - **Do not run `npm login`** — `mobiscroll config` sets up Mobiscroll's private NPM registry authentication automatically. - **Do not run `npm install @mobiscroll/...`** — the CLI adds and installs the Mobiscroll package for you. - **Do not set up a license key manually** — the CLI configures your license when you run `mobiscroll config`. ::: :::info If you're working behind a proxy, additional configuration might be needed. Please check the [proxy configuration options](https://mobiscroll.com/docs/core-concepts/cli#using-the-cli-behind-a-proxy) of the CLI. ::: The command will ask for your credentials (email and password). If you already have a mobiscroll account but you are unsure about the details, you find them on your [account page](https://mobiscroll.com/account). If you don't have an account yet, you can start a trial in no time following [these steps](./installation.md#starting-with-the-trial). :::info If you already have a license, it is recommended to set up and use [team NPM accounts](http://help.mobiscroll.com/en/articles/8095168-team-npm-accounts) instead of individual developer credentials for installing Mobiscroll. ::: ### Step 4: Importing Mobiscroll to your page You will need to import the component you want to use and the css from the mobiscroll package. For example, let's import the `Datepicker` to the `src/views/Tab1Page.vue` page. ```html title="src/views/Tab1Page.vue" ``` ### Step 5: Let's see if Mobiscroll was installed correctly To build the app just run the serve command in the CLI: ```bash ionic serve ``` At this point you have completed the setup. Go build great things! :::info One more thing **Setting up for CI/CD** The config command in [step 3](#step-3-configure-the-project-using-the-cli) will create a file named `.npmrc` in the project root, containing the access tokens to the Mobiscroll NPM registry. Commit this file into the repository to ensure the package will install for other team members and in CI/CD environments. If you are using Yarn or Docker, check out the [setup instructions here](./installation.md#setting-up-for-cicd). ::: --- ## Accessibility ## Overview We want our products to be fully experienced by the widest number of users including disabled users. We take accessibility pretty seriously and spent a couple of iterations on it. By adhering to standards like [WAI-ARIA](http://www.w3.org/WAI/PF/aria-practices/), [Section 508](http://www.section508.gov/), and [WCAG 2.2](https://www.w3.org/TR/WCAG/) we create accessible products that can be used well together with an assistive technology, like a screen reader. Since the technology has evolved, nowadays not only basic text-driven experiences have to be made accessible, but also other features. ## Accessibility Compliance Mobiscroll components are designed to support WCAG-based accessibility standards and can be used to build applications aligned with major public-sector accessibility frameworks worldwide. They are largely aligned with WCAG 2.2 A and AA requirements, with strong support for keyboard navigation, WAI-ARIA, and screen reader compatibility. However, full WCAG AA compliance is not yet achieved, as WCAG 1.4.3 Contrast (Minimum) is not fully supported in all cases. This known limitation is actively being addressed in upcoming releases. Mobiscroll can therefore support the development of applications targeting major global accessibility regulations, while full compliance depends on the complete application implementation and resolving this remaining gap. #### Mobiscroll can be used in applications targeting frameworks such as: - 🇪🇺 EN 301 549 (European Union) - 🇫🇷 RGAA (France) - 🇺🇸 Section 508 (United States) - 🇨🇦 AODA (Canada) As well as other WCAG-aligned national regulations: - 🇩🇪 BITV 2.0 (Germany) - 🇮🇹 Legge Stanca (Italy) - 🇪🇸 UNE 139803 (Spain) - 🇳🇱 DigiToegankelijk (Netherlands) - 🇸🇪 DOS-lagen (Sweden) - 🇩🇰 Web Accessibility Act (Denmark) - 🇫🇮 Act on Digital Services (Finland) - 🇳🇴 Universal Design of ICT (Norway) - 🇬🇧 Public Sector Accessibility Regulations (UK) - 🇯🇵 JIS X 8341-3 (Japan) - 🇮🇱 Standard 5568 (Israel) #### Compliance responsibility Mobiscroll provides accessible UI components intended to support WCAG-based development. It does not, by itself, ensure that an application is fully compliant with accessibility regulations. Organizations using Mobiscroll are responsible for: - publishing an accessibility statement - maintaining accessibility monitoring and audits - implementing accessibility governance processes - ensuring content, structure, and workflows meet accessibility requirements ## WCAG 2.2 The [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/WAI/standards-guidelines/wcag/) provide guidelines developed by the World [Wide Web Consortium (W3C)](https://www.w3.org/) to ensure web content is accessible to people with disabilities. WCAG 2.2 establishes a framework of accessibility principles and their associated success criteria. The level of accessibility conformance achieved by a web application is determined by the extent to which it meets these success criteria, categorized into three levels: A, AA, and AAA. While Mobiscroll components are not fully compliant with WCAG 2.2 at this time, we are committed to enhancing their accessibility. We are actively working on improving compliance and continuously making progress. The guidelines and success criteria are organized around the following four principles: ### [1. Perceivable](https://www.w3.org/TR/WCAG22/#perceivable) Information and user interface components must be presentable to users in ways they can perceive. Guidelines Level Compatibility 1.1 Text Alternatives 1.1.1 Non-text Content A Supported 1.2 Time-based Media 1.2.1 Audio-only and Video-only (Prerecorded) A Not Applicable 1.2.2 Captions (Prerecorded) A Not Applicable 1.2.3 Audio Description or Media Alternative (Prerecorded) A Not Applicable 1.2.4 Captions (Live) AA Not Applicable 1.2.5 Audio Description (Prerecorded) AA Not Applicable 1.2.6 Sign Language (Prerecorded) AAA Not Applicable 1.2.7 Extended Audio Description (Prerecorded) AAA Not Applicable 1.2.8 Media Alternative (Prerecorded) AAA Not Applicable 1.2.9 Audio-only (Live) AAA Not Applicable 1.3 Adaptable 1.3.1 Info and Relationships A Supported 1.3.2 Meaningful Sequence A Supported 1.3.3 Sensory Characteristics A Supported 1.3.4 Orientation AA Supported 1.3.5 Identify Input Purpose AA Supported 1.3.6 Identify Purpose AAA Supported 1.4 Distinguishable 1.4.1 Use of Color A Supported 1.4.2 Audio Control A Not Applicable 1.4.3 Contrast (Minimum) AA Not fully supported 1.4.4 Resize Text AA Supported 1.4.5 Images of Text AA Not Applicable 1.4.6 Contrast (Enhanced) AAA Not fully supported 1.4.7 Low or No Background Audio AAA Not Applicable 1.4.8 Visual Presentation AAA Supported 1.4.9 Images of Text (No Exception) AAA Not Applicable 1.4.10 Reflow AA Supported 1.4.11 Non-text Contrast AA Supported 1.4.12 Text Spacing AA Supported 1.4.13 Content on Hover or Focus AA Supported ### [2. Operable](https://www.w3.org/TR/WCAG22/#operable) User interface components and navigation must be operable. Guidelines Level Compatibility 2.1 Keyboard Accessible 2.1.1 Keyboard A Supported 2.1.2 No Keyboard Trap A Supported 2.1.3 Keyboard (No Exception) AAA Supported 2.1.4 Character Key Shortcuts A Not Applicable 2.2 Enough Time 2.2.1 Timing Adjustable A Supported 2.2.2 Pause, Stop, Hide A Not Applicable 2.2.3 No Timing AAA Supported 2.2.4 Interruptions AAA Supported 2.2.5 Re-authenticating AAA Not Applicable 2.2.6 Timeouts AAA Not Applicable 2.3 Seizures and Physical Reactions 2.3.1 Three Flashes or Below Threshold A Supported 2.3.2 Three Flashes AAA Supported 2.3.3 Animation from Interactions AAA Supported 2.4 Navigable 2.4.1 Bypass Blocks A Not Applicable 2.4.2 Page Titled A Not Applicable 2.4.3 Focus Order A Supported 2.4.4 Link Purpose (In Context) A Not Applicable 2.4.5 Multiple Ways AA Not Applicable 2.4.6 Headings and Labels AA Supported 2.4.7 Focus Visible AA Supported 2.4.8 Location AAA Not Applicable 2.4.9 Link Purpose (Link Only) AAA Not Applicable 2.4.10 Section Headings AAA Not Applicable 2.4.11 Focus Not Obscured (Minimum) AA Supported 2.4.12 Focus Not Obscured (Enhanced) AAA Supported 2.4.13 Focus Appearance AAA Not fully supported 2.5 Input Modalities 2.5.1 Pointer Gestures A Supported 2.5.2 Pointer Cancellation A Supported 2.5.3 Label in Name A Supported 2.5.4 Motion Actuation A Not Applicable 2.5.5 Target Size (Enhanced) AAA Not fully supported 2.5.6 Concurrent Input Mechanisms AAA Supported 2.5.7 Dragging Movements AA Supported 2.5.8 Target Size (Minimum) AA Supported ### [3. Understandable](https://www.w3.org/TR/WCAG22/#understandable) Information and the operation of user interface must be understandable. Guidelines Level Compatibility 3.1 Readable 3.1.1 Language of Page A Not Applicable 3.1.2 Language of Parts AA Not Applicable 3.1.3 Unusual Words AAA Not Applicable 3.1.4 Abbreviations AAA Supported 3.1.5 Reading Level AAA Not Applicable 3.1.6 Pronunciation AAA Not Applicable 3.2 Predictable 3.2.1 On Focus A Supported 3.2.2 On Input A Not Applicable 3.2.3 Consistent Navigation AA Not Applicable 3.2.4 Consistent Identification AA Not Applicable 3.2.5 Change on Request AAA Not Applicable 3.2.6 Consistent Help A Not Applicable 3.3 Input Assistance 3.3.1 Error Identification A Supported 3.3.2 Labels or Instructions A Supported 3.3.3 Error Suggestion AA Supported 3.3.4 Error Prevention (Legal, Financial, Data) AA Not Applicable 3.3.5 Help AAA Not Applicable 3.3.6 Error Prevention (All) AAA Not Applicable 3.3.7 Redundant Entry A Not Applicable 3.3.8 Accessible Authentication (Minimum) AA Not Applicable 3.3.9 Accessible Authentication (Enhanced) AAA Not Applicable ### [4. Robust](https://www.w3.org/TR/WCAG22/#robust) Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. Guidelines Level Compatibility 4.1 Compatible 4.1.1 Parsing (Obsolete and removed) - - 4.1.2 Name, Role, Value A Supported 4.1.3 Status Messages AA Supported ### WCAG compliance for each component WCAG compliance levels for each Mobiscroll component: - [Datepicker](../datepicker/accessibility#wcag-22) - [Eventcalendar](../eventcalendar/accessibility#wcag-22) - [Select](../select/accessibility#wcag-22) - [Popup](../popup/accessibility#wcag-22) - [Alerts & notifications](../notifications/accessibility#wcag-22) - [Forms](../forms/accessibility#wcag-22) ## Section 508 ### [Section 1194.21](https://www.access-board.gov/ict/#d21) - Software applications and operating systems The following table shows the level of support that Mobiscroll provides for the Section 1194.21 Criteria Supporting features Remarks (a) When software is designed to run on a system that has a keyboard product functions shall be executable from a keyboard where the function itself or the result of performing a function can be discerned textually. Supported Native html keyboard support kept where relevant, custom key bindings added where needed (b) Applications shall not disrupt or disable activated features of other products that are identified as accessibility features where those features are developed and documented according to industry standards. Applications also shall not disrupt or disable activated features of any operating system that are identified as accessibility features where the application programming interface for those accessibility features has been documented by the manufacturer of the operating system and is available to the product developer. Supported Mobiscroll does nothing to disrupt or disable activated accessibility features (c) A well-defined on-screen indication of the current focus shall be provided that moves among interactive interface elements as the input focus changes. The focus shall be programmatically exposed so that assistive technology can track focus and focus changes. Supported In some cases the browser’s native focus indicator styling is overwritten with custom styling (d) Sufficient information about a user interface element including the identity operation and state of the element shall be available to assistive technology. When an image represents a program element the information conveyed by the image must also be available in text. Supported Using WAI-ARIA,roles and attributes where applicable (e) When bitmap images are used to identify controls status indicators or other programmatic elements the meaning assigned to those images shall be consistent throughout an application’s performance. Not Applicable (f) Textual information shall be provided through operating system functions for displaying text. The minimum information that shall be made available is text content text input caret location and text attributes. Not Applicable (g) Applications shall not override user selected contrast and color selections and other individual display attributes. Not Applicbale (h) When animation is displayed the information shall be displayable in at least one non-animated presentation mode at the option of the user. Not Applicable (i) Color coding shall not be used as the only means of conveying information indicating an action, prompting a response or distinguishing a visual element. Not Applicable (j) When a product permits a user to adjust color and contrast settings a variety of color selections capable of producing a range of contrast levels shall be provided. Not Applicable (k) Software shall not use flashing or blinking text, objects, or other elements having a flash or blink frequency greater than 2 Hz and lower than 55 Hz. Supported No flashing or blinking elements are used (l) When electronic forms are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues. Supported Mobiscroll Forms are accessible to assistive technologies ### [Section 1194.22](https://www.access-board.gov/ict/#d22) - Web-based intranet and Internet information and applications The following table shows the level of support that Mobiscroll provides for the Section 1194.21 Criteria Supporting features Remarks (a) A text equivalent for every non-text element shall be provided (e.g., via “alt", “longdesc", or in element content). Supported (b) Equivalent alternatives for any multimedia presentation shall be synchronized with the presentation. Not Applicable No multimedia is used (c) Web pages shall be designed so that all information conveyed with color,is also available without color for example from context or markup. Supported (d) Documents shall be organized so they are readable without requiring an associated style sheet. Not fully supported We’re providing an UI Framework for styling content. Removing style sheets doesn’t make sense (e) Redundant text links shall be provided for each active region of a server-side image map. Not Applicable No image maps are used (f) Client-side image maps shall be provided instead of server-side image maps except where the regions cannot be defined with an available geometric shape. Not Applicable No image maps are used (g) Row and column headers shall be identified for data tables. Not Applicable No data tabels are used (h) Markup shall be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers. Not Applicable No data tabels are used (i) Frames shall be titled with text that facilitates frame identification and navigation. Not Applicable No frames are used (j) Pages shall be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and lower than 55 Hz. Supported No flashing or blinking elements are used (k) A text-only page with equivalent information or functionality shall be provided to make a web site comply with the provisions of this part, when compliance cannot be accomplished in any other way. The content of the text-only page shall be updated whenever the primary page changes. Not Applicable The developer is responsible for providing text-only content for pages that use Mobiscroll (l) When pages utilize scripting languages to display content or to create interface elements the information provided by the script shall be identified with functional text that can be read by assistive technology. Supported Mobiscroll provides keyboard navigation support and screen reader support (via ARIA attributes) (m) When a web page requires that an applet, plug-in or other application be present on the client system to interpret page content the page must provide a link to a plug-in or applet that complies with §1194.21(a),through (l). Not Supported (n) When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information field elements and functionality required for completion and submission of the form including all directions and cues. Supported Mobiscroll Forms are accessible to assistive technologies (o) A method shall be provided that permits users to skip repetitive navigation links. Not Applicable (p) When a timed response is required the user shall be alerted and given sufficient time to indicate more time is required. Not Applicable ## WAI-ARIA Support WAI-ARIA is a World Wide Web Consortium specification that was designed to be a framework for web developers. This can be used in developing applications that leverage Ajax, scripting and other so called “rich application" techniques. This framework has clear specifications about steps that developers can use in order to make their applications more accessible to assistive technologies. WAI-ARIA’s role is to fill the gap between rich applications and disabled users by using additional metadata with the help of HTML element attributes that screen readers can use to reason about a control or DOM element. These attributes, like role, aria-haspopup, aria-selected and others provide vital information to screen readers, which can then be used to provide a richer level of interaction with applications and websites. Here is the complete list of WAI-ARIA attributes used by Mobiscroll: - `role="dialog"` for popups and pickers - `role="grid"` for calendar view - `role="row"` for calendar view rows - `role="gridcell"` for calendar views cells - `role="listbox"` for scroller wheels - `role="option"` for scroller wheel items - `role="button"` for button controls - `aria-live` for announcements - `aria-hidden` for elements which are not visible and should not be read by screen readers - `aria-label` for controls without text or icon buttons - `aria-selected` for indicating selected value on wheels and calendar days - `aria-multiselectable` for multiple select - `aria-disabled` for disabled items (wheel items, buttons, calendar days) ## Support Right-To-Left (RTL) Languages Only a few languages in the world use RTL text direction, but these languages cover over a billion people. Beside it’s internationalization characteristic RTL is about making user experiences more accessible for users working in Right-to-left languages like, so we are considering this as an accessibility feature as well. Mobiscroll supports RTL for every component, which can be activated with the `rtl: true` option. ## Keyboard Support Mobiscroll ensures that your users can access the full capabilities of widgets using just the keyboard. The following keyboard bindings are used by Mobiscroll: - [Datepicker](../datepicker/accessibility) - [Eventcalendar](../eventcalendar/accessibility) - [Select](../select/accessibility) - [Popup](../popup/accessibility) - [Alerts & notifications](../notifications/accessibility) - [Form components](../forms/accessibility) --- ## Mobiscroll CLI ## Overview The Mobiscroll Command Line Interface helps to install and configure the mobiscroll library into a project. :::info Requires Node.js 11 or newer. ::: ## Installation Using the node package manager (npm), the Mobiscroll CLI can be installed with the following command: ```bash $ npm install -g @mobiscroll/cli ``` :::info On Windows client computers, the execution of PowerShell scripts is disabled by default. When using Powershell, to be able to install the Mobiscroll CLI you will need to set the following [execution policy](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.3): `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned` Make sure to read the message displayed after executing the command and follow the instructions. ::: ## Config Configures your current project with the Mobiscroll resources and dependencies. Use the `--version` option to define which supported main version would you like to install: ```bash title='Install the latest version' $ mobiscroll config [types] [options] ``` ```bash title='Install the latest v4 version' $ mobiscroll config [types] [options] --version=4 ``` Options: - `-t`, `--trial`: The project will be configured with the trial version. - `-n`, `--no-npm`: This option can be used if you are building a custom package with the [download builder](http://help.mobiscroll.com/en/articles/974201-download-builder). Mobiscroll resources won't be installed from npm. In this case the Mobiscroll resources must be copied manually to the `src/lib` folder from the downloaded package. - `-h`, `--help`: Output usage information. - `--proxy [url]`: Define a proxy URL which will be passed to the internal requests. - `--scss`: The project will be configured with scss styles instead of css. - `--css`: The project will be configured with css styles instead of scss. - `--legacy-peer-deps`: This option will be passed to internally executed `npm install` command. - `--version [version]`: Pass the Mobiscroll version which you want to install. It supports semver versions (`--version="4.10.7"`) and main versions (`--version="4"`). In case of main version it will install the latest package available. Types: - `angular`: Use it for configuring Angular 4+ applications. - `ionic`: Use it for configuring Ionic 2.2.0+ applications. - `javascript`: Use it for configuring JavaScript applications. Use it with frameworks like: Knockout, Ember.js... - `jquery`: Use it for configuring jQuery 1.7+ applications. - `react`: Use it for configuring React 16.2+ applications. - `vue`: Use it for configuring Vue 3+ applications. ## Login Logs you in to the Mobiscroll npm registry. (Use the `--global` flag if you want to login globally). ```bash $ mobiscroll login [options] ``` Options: - `-h`, `--help`: output usage information. ## Logout Logs you out from the Mobiscroll npm registry. (Use the `--global` flag if you want to log out globally). ```bash $ mobiscroll logout [options] ``` Options: - `-h`, `--help`: output usage information. ## Using the CLI behind a proxy If you're behind a proxy, the `mobiscroll` command might not work out of the box. There are multiple ways to solve this. 1. Using environment variables The preferred way is to set the `http_proxy` and `https_proxy` environment variables on your system. This is usually needed for other CLI commands as well which are making requests and needs to be routed through a proxy server as well. ```bash title='Mac OS / Linux' $ export http_proxy=http://myuser:mypassword@myproxy.com:1234 $ export https_proxy=http://myuser:mypassword@myproxy.com:1234 ``` This will set the environment variables for the current terminal session. To permanently set the variables, add the above lines to your user's `~/.bash_profile` or `~/.zshrc` files. ```bash title='Windows' $ setx HTTP_PROXY "http://myuser:mypassword@myproxy.com:1234" $ setx HTTPS_PROXY "http://myuser:mypassword@myproxy.com:1234" ``` The `setx` command will permanently set the environment variables. 2. Using the `--proxy` parameter The quick and dirty method without the need to modify any system configuration, is to pass the proxy address to the `mobiscroll config` command using the `--proxy` option. This will be used for any external request made to our servers or the npm registry. ```bash $ mobiscroll config [framework] --proxy http://myuser:mypassword@myproxy.com:1234 ``` --- ## Global options Global options can be used to set options for all components used on a page. Useful for speicifying application-wide options, like theme and locale. You can use the `setOptions` utility function to specify the global options. It can be called on initial page load or any time later. All existing component on the page will be updated with the new options, and components instantiated later will take into account the new global options. Components can override the global options with their individual options, e.g. if a component has a specific theme specified, it will override the global theme option. ```html ``` --- ## Instance ## Overview In object-oriented programming (OOP), an instance is a specific realization of a class. Similarly, in the scope of the Mobiscroll library, a component instance is a realization of the component class. The instantiation (the creation of objects from a class) in case of the Mobiscroll components is done by the Vue framework, and accessing the component instances are only needed in a few specific cases. ## Getting the instance ### Inside events A reference to the component instance is available in every Mobiscroll event as the second argument of the event handler. ```html ``` ### Using refs To get the instance of a component there is a special attribute called `ref`. The `ref` attribute is used to obtain a direct reference to the DOM element it is placed on. In the case of [components](https://vuejs.org/guide/essentials/template-refs.html#ref-on-component), the `ref` attribute will return the Vue component. :::info Usually for Vue components the public methods and properties are on the Vue component itself, returned by the `ref` attribute. In the case of the Mobiscroll Vue components, this is **different**. The `instance` property is the only accessible property and all the methods must be accessed through it. ::: ```html title="Getting the instance of a Mobiscroll Eventcalendar" ``` ## Calling methods :::caution Calling the instance methods should be necessary only in a few selected cases. Almost every case can be solved with passing props to the component and using it's events rather than calling instance methods. Before implementing a solution, please take into consideration using props and events first. ::: All the component methods are documented on each components API section. The methods can be called on the component instances through the `instance` property as described in the previous section. #### Example: Getting invalid dates for a date range One such a case when you might need to call an instance method would be to get the invalid data for a time period from the eventcalendar. Since the invalid data you pass to the Eventcalendar can contain recurring rules, you need a way to calculate the actual occurences. Luckily the Eventcalendar has a method that will return the actual occurences for a time period. ```javascript title="Invalid rule that repeats on specific days" const invalidsArray = [ { start: '2023-10-18', allDay: true, recurring: { repeat: 'weekly', weekDays: 'MO,FR,SA', interval: 1 } } ] ``` To get the actual invalid days for the month of November, you can call the [`getInvalids`](../eventcalendar/api#method-getInvalids) method of the Eventcalendar instance. ```html title="The invalids array needs to be passed to the eventcalendar" ``` ```javascript function getOccurences() { const occurences = instRef.value.instance.getInvalids('2023-11-01', '2023-12-01'); } ``` The result in this case will be an array of objects, each of them being an occurence of an invalid day in November. --- ## Localization ## Overview The Mobiscroll components offer comprehensive localization features, ensuring they can be seamlessly integrated into any project worldwide. These features include: - the ability to format dates and times according to regional preferences - the components allow for the customization of button labels and other interface text, making it easy to translate these elements into any language - support for right-to-left (RTL) text direction, which is essential for languages like Arabic and Hebrew These localization capabilities ensure that Mobiscroll components provide a user-friendly and culturally appropriate experience for users across different regions and languages. ## Localization options for components - [Date & time picker](/vue/datepicker/api#localization) - [Event Calendar](/vue/eventcalendar/api#localization) - [Select](/vue/select/api#localization) - [Popup](/vue/popup/api#localization) - Forms - check out the localization options under the different Form components - Localization section - [Alert](/vue/notifications/alert#localization) - [Confirm](/vue/notifications/confirm#localization) - [Prompt](/vue/notifications/prompt#localization) - [Button](/vue/forms/button#localization) - [Checkbox](/vue/forms/checkbox#localization) - [Dropdown](/vue/forms/dropdown#localization) - [Input](/vue/forms/input#localization) - [Radio button](/vue/forms/radio#localization) - [Segmented](/vue/forms/segmented#localization) - [Stepper](/vue/forms/stepper#localization) - [Switch](/vue/forms/switch#localization) - [Textarea](/vue/forms/textarea#localization) ## Localization options Here is a comprehensive list of all the localization options for Mobiscroll components. ### 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` ### cancelText string Text for the button which cancels the dialog. **Default value**: `'Cancel'` ### closeText string Text for the "Close" button. **Default value**: `'Close'` ### 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](#localization-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](#localization-dateFormat) option. **Default value**: `'D DDD MMM YYYY'` ### dateText string Specifies the accessibility label for the date wheel. **Default value**: `'Date'` ### dateWheels string Display order and formatting for month/day/year wheels. Characters have the same meaning as in the [dateFormat](#localization-dateFormat) option. The options also controls if a specific wheel should appear or not, e.g. use `'MMMMYYYY'` to display month and year wheels only, `'MMDDD DDYYYY'` to display both day of week and date on the day wheel. If not specified, the order of the wheels will be taken from the [dateFormat](#localization-dateFormat) option, and the formatting will be defined by the [theme](#opt-theme). To display the whole date on one wheel, the format of the date should be specified between `|` characters: ```js dateWheels: '|DDD MMM D|' // Will produce 'Sun Sep 9' ``` **Default value**: `undefined` ### dayNames Array The list of long day names, starting from Sunday. **Default value**: `['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']` ### dayNamesMin Array The list of minimal day names, starting from Sunday. **Default value**: `['S', 'M', 'T', 'W', 'T', 'F', 'S']` ### dayNamesShort Array The list of abbreviated day names, starting from Sunday. **Default value**: `['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']` ### daySuffix string Additional string to display after the day on the wheel. **Default value**: `undefined` ### dayText string Specifies the accessibility label for the day wheel. **Default value**: `'Day'` ### eventsText string Text for the events word (plural). **Default value**: `'events'` ### eventText string Text for the event word. **Default value**: `'event'` ### filterEmptyText string Text for the empty state of the Select. The Select will show this message, when [filtering](#opt-filter) is turned on and there are no results for the searched text. **Default value**: `'No results'` ### filterPlaceholderText string Placeholder text for the filter input, when [filtering](#opt-filter) is turned on. **Default value**: `'Search'` ### firstDay number Set the first day of the week: Sunday is 0, Monday is 1, etc. **Default value**: `0` ### groupText string Specifies the accessibility label for the group wheel, when present. **Default value**: `'Group'` ### hourText string Specifies the accessibility label for the hour wheel. **Default value**: `'Hour'` ### locale 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](https://mobiscroll.com/docs/core-concepts/localization#language-modules). 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` ### minuteText string Specifies the accessibility label for the minute wheel. **Default value**: `'Minute'` ### monthNames Array The list of full month names. **Default value**: `['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']` ### monthNamesShort Array The list of abbreviated month names. **Default value**: `['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']` ### monthSuffix string Additional string to display after the month on the wheel. **Default value**: `undefined` ### monthText string Specifies the accessibility label for the month wheel. **Default value**: `'Month'` ### 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](#localization-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](#localization-moreEventsPluralText) as well, if the plural form is different. **Default value**: `'{count} more'` ### newEventText string Title for the newly created event with the [dragToCreate](#opt-dragToCreate) and the [clickToCreate](#opt-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'` ### okText string Text for the button which closes the dialog. **Default value**: `'OK'` ### 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}'` ### rangeEndHelp string When selecting a range, it specifies the placeholder text for the end value under the [end label](#opt-showRangeLabels). **Default value**: `'Please select'` ### rangeEndLabel string When selecting a range, it specifies the text of the [end label](#opt-showRangeLabels). **Default value**: `'End'` ### rangeStartHelp string When selecting a range, it specifies the placeholder text for the start value under the [start label](#opt-showRangeLabels). **Default value**: `'Please select'` ### rangeStartLabel string When selecting a range, it specifies the text of the [start label](#opt-showRangeLabels). **Default value**: `'Start'` ### rtl boolean Enables right-to-left display. **Default value**: `false` ### secondText string Specifies the accessibility label for the second wheel. **Default value**: `'Second'` ### selectedPluralText string Specifies the plural form of the amount of selected items according to the rules of particular language. The '{count}' substring will be replaced with the number of selected items. **Default value**: `'{count} selected'` ### selectedText string Specifies the amount of selected items according to the rules of particular language. The '{count}' substring will be replaced with the number of selected items. **Default value**: `'{count} selected'` ### setText string Text for the "Set" button. **Default value**: `'Set'` ### 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'` ### timeText string Specifies the accessibility label for the time wheel. **Default value**: `'Time'` ### timeWheels string Display order and formatting of the time wheels. Characters have the same meaning as in the [timeFormat](#localization-timeFormat) option. If not specified, the order of the wheels will be taken from the [timeFormat](#localization-timeFormat) option, and the formatting will be defined by the theme. To display the whole time on one wheel, the format of the time should be specified between `|` characters: ```js timeWheels: '|h:mm A|' // Will produce '9:12 AM' ``` **Default value**: `undefined` ### 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}'` ### yearSuffix string Additional string to display after the year on the wheel. **Default value**: `undefined` ### yearText string Specifies the accessibility label for the year wheel. **Default value**: `'Year'` ## Language modules We offer and support a number of translations for the Mobiscroll library. If you don't find the language you're looking for, no problem. It's easy to create a language module that you can use. The `locale` option can be used to set the language of a component. It takes an object, that should contain the translations of the texts used in the component. The supported languages can be set directly from the mobiscroll bundle. ```html title='Locale option usage' ``` Creating your own locale object is simple as creating an object in JavaScript. For example, the Cancel button on many Mobiscroll components uses the `cancelText` property. If you want to provide a translation for it, the locale object would look like this: ```html title='Creating a locale object' ``` The exact properties for each component can be found [above](#localization-options-for-components). For typescript environments, the `MbscLocale` type can also be used as the base type for the locale object. ```html title='Example with types' ``` Here's a template to use for the locale object: ```javascript title='Template' const myLocale = { // Core setText: 'OK', cancelText: 'Mégse', clearText: 'Törlés', selectedText: '{count} kiválasztva', // Datetime component dateFormat: 'YYYY.MM.DD.', dateFormatLong: 'YYYY. MMM. D., DDD', dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], dayNamesShort: ['Va', 'Hé', 'Ke', 'Sze', 'Csü', 'Pé', 'Szo'], dayNamesMin: ['V', 'H', 'K', 'Sz', 'Cs', 'P', 'Sz'], dayText: 'Nap', delimiter: '.', hourText: 'Óra', minuteText: 'Perc', monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], monthText: 'Hónap', secText: 'Másodperc', timeFormat: 'H:mm', yearText: 'Év', nowText: 'Most', pmText: 'pm', amText: 'am', // Calendar component firstDay: 1, dateText: 'Dátum', timeText: 'Idő', todayText: 'Ma', prevMonthText: 'Előző hónap', nextMonthText: 'Következő hónap', prevYearText: 'Előző év', nextYearText: 'Következő év', closeText: 'Bezár', eventText: 'esemény', eventsText: 'esemény', allDayText: 'Egész nap', noEventsText: 'Nincs esemény', moreEventsText: '{count} további', } ``` --- ## Recurrence Some of the Eventcalendar and Datepicker options support recurrence rules. Recurrence rules regulate if the particular option (event, label, mark, etc.) reoccures periodically. For example the [data](../eventcalendar/api#opt-data), [colors](../eventcalendar/api#opt-colors), [labels](../eventcalendar/api#opt-labels), [marked](../eventcalendar/api#opt-labels), and [invalid](../eventcalendar/api#opt-invalid) options of the Eventcalendar or the [colors](../datepicker/api#opt-colors), [marked](../datepicker/api#opt-marked), [labels](../datepicker/api#opt-labels) and [invalid](../datepicker/api#opt-invalid) options of the Datepicker support recurrence rules through their `recurring` property. The rule can be an object or a string in `RRULE` format. ## Supported properties When specifying the recurring rule **as an object**, the following properties are supported: - `repeat`: *string* - The frequency of the recurrence. String equivalent: `FREQ`. - `'daily'` - Daily repeat - `'weekly'` - Weekly repeat - `'monthly'` - Monthly repeat - `'yearly'` - Yearly repeat - `day`: *number | Array* - The day of the month in case of monthly and yearly repeat. String equivalent: `BYMONTHDAY`. Negative numbers are calculated from the end of the month, -1 meaning the last day of the month. - `month`: *number | Array* - Specify the month in case of yearly repeat. String equivalent: `BYMONTH`. - `weekDays`: *string* - Comma separated list of the week days ('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA') for the occurrences. String equivalent: `BYDAY`. - `weekStart`: *string* - Specifies the first day of the week ('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'). Default is 'MO'. String equivalent: `WKST`. - `pos`: *number* - Specifies the nth occurrence of the weekdays in a month in case of the monthly and yearly repeat. It also supports negative values in this case the order will be counted from the end of the month. This property depends on the repeat property. String equivalent: `BYSETPOS`. - `count`: *number* - The number of occurrences. String equivalent: `COUNT`. - `from`: *string | Date | object* - The start date of the occurrences. String equivalent: `DTSTART`. - `until`: *string | Date | object* - The end date of the occurrences. String equivalent: `UNTIL`. - `interval`: *number* - The time interval for the rule, e.g. every 3 days, or every 2 weeks. This depends on the repeat property. String equivalent: `INTERVAL`. ```javascript title="Rule specified as an object" recurring: { repeat: 'daily', count: 5, interval: 2 } ``` When specified **as a string**, the properties are separated by the `;` character. ```javascript title="Rule specified as a string" recurring: 'FREQ=DAILY;COUNT=5;INTERVAL=2' ``` ## Rule exceptions In case you would like to skip some dates from your rule, that's when the recurring exception come in handy. You can either set specific dates and/or a recurring rule as an exception, using the `recurringException` and the `recurringExceptionRule` properties. ```javascript title="Excluding exact dates from a daily repeating event" // repeats daily, every day recurring: { repeat: 'daily', interval: 1 }, // except on these dates recurringException: ['2023-07-10','2023-07-23','2023-07-28'], ``` The `recurringExceptionRule` property is usefull when there is a rule to the exception you want to enforce. For example, you want to exclude the first day of each month: ```javascript title="Excluding the first day of each month from a daily repeating event" // repeats daily, every day recurring: { repeat: 'daily', interval: 1 }, // except on the 1st day of each month: recurringExceptionRule: { repeat: 'monthly', day: 1, interval: 1 } ``` :::info In case you drag & drop an event on the calendar which is an occurrence of a recurring event, a new event will be created for the moved or resized event and the occurrence date will be added as a recurring exception to the original recurring event. ::: :::tip There is a [recurring exception configurator demo](https://demo.mobiscroll.com/scheduler/recurring-events) that can be used to experiment with the rules. Check it out on the previous link! ::: ## Full example ```html title="Recurring events on the eventcalendar" ``` --- ## Accessibility(Eventcalendar) ## Keyboard Support The Eventcalendar supports different [views](./api#opt-view) for different jobs and each of these views support keyboard navigation. Focus can be moved with the `Tab` key. Focusable elements depend on the displayed view (more details below). Buttons can be triggered using the `Space` key when focused. Rendered events act like buttons. When an event is focused, the [event click](./api#event-onEventClick) event can be triggered using the `Space` or `Enter` keys. ### Calendar view Focusable elements are: * the header buttons: navigation, prev, next and today buttons * the events rendered on the calendar view * the currently selected day When the selected day is focused, the focus can be moved using the `Up`, `Down`, `Left` and `Right` arrow keys and set with the `Space` or `Enter` keys. When the popover is enabled on events, it can be toggled using the `Space` and `Esc` keys. ### Agenda Focusable elements are: * the header buttons: navigation, prev, next and today buttons * the currently selected day * the events listed in the agenda ### Scheduler Focusable elements are: * the header buttons: navigation, prev, next and today buttons * the events rendered in the scheduler ### Timeline Focusable elements are: * the header buttons: navigation, prev, next and today buttons * the events rendered on the timeline ## WCAG 2.2 The [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/WAI/standards-guidelines/wcag/) provide guidelines developed by the World [Wide Web Consortium (W3C)](https://www.w3.org/) to ensure web content is accessible to people with disabilities. WCAG 2.2 establishes a framework of accessibility principles and their associated success criteria. The level of accessibility conformance achieved by a web application is determined by the extent to which it meets these success criteria, categorized into three levels: A, AA, and AAA. While Mobiscroll components are not fully compliant with WCAG 2.2 at this time, we are committed to enhancing their accessibility. We are actively working on improving compliance and continuously making progress. The guidelines and success criteria are organized around the following four principles: ### [1. Perceivable](https://www.w3.org/TR/WCAG22/#perceivable) Information and user interface components must be presentable to users in ways they can perceive. Guidelines Level Compatibility Remarks 1.1 Text Alternatives 1.1.1 Non-text Content A Supported aria-label on icon buttons, aria-hidden on decoration elements 1.2 Time-based Media 1.2.1 Audio-only and Video-only (Prerecorded) A Not Applicable - 1.2.2 Captions (Prerecorded) A Not Applicable - 1.2.3 Audio Description or Media Alternative (Prerecorded) A Not Applicable - 1.2.4 Captions (Live) AA Not Applicable - 1.2.5 Audio Description (Prerecorded) AA Not Applicable - 1.2.6 Sign Language (Prerecorded) AAA Not Applicable - 1.2.7 Extended Audio Description (Prerecorded) AAA Not Applicable - 1.2.8 Media Alternative (Prerecorded) AAA Not Applicable - 1.2.9 Audio-only (Live) AAA Not Applicable - 1.3 Adaptable 1.3.1 Info and Relationships A Supported - 1.3.2 Meaningful Sequence A Supported - 1.3.3 Sensory Characteristics A Supported - 1.3.4 Orientation AA Supported responsiveness works with all orientations 1.3.5 Identify Input Purpose AA Not applicable - 1.3.6 Identify Purpose AAA Supported - 1.4 Distinguishable 1.4.1 Use of Color A Supported - 1.4.2 Audio Control A Not Applicable - 1.4.3 Contrast (Minimum) AA Not fully supported by building a height contrast theme 1.4.4 Resize Text AA Supported - 1.4.5 Images of Text AA Not Applicable - 1.4.6 Contrast (Enhanced) AAA Not fully supported by building a height contrast theme 1.4.7 Low or No Background Audio AAA Not Applicable - 1.4.8 Visual Presentation AAA Supported by building a custom theme or custom CSS 1.4.9 Images of Text (No Exception) AAA Not Applicable - 1.4.10 Reflow AA Supported in case of Scheduler and Timeline two dimensional scrolling could be necessary but these views are data tables 1.4.11 Non-text Contrast AA Supported borders 1.4.12 Text Spacing AA Supported can be modified with custom CSS 1.4.13 Content on Hover or Focus AA Supported title attribute on event hover ### [2. Operable](https://www.w3.org/TR/WCAG22/#operable) User interface components and navigation must be operable. Guidelines Level Compatibility Remarks 2.1 Keyboard Accessible 2.1.1 Keyboard A Supported D&D works with mouse and touch control but keyboard alternatives can be implemented ex. add/edit popup 2.1.2 No Keyboard Trap A Supported - 2.1.3 Keyboard (No Exception) AAA Supported D&D works with mouse and touch control but keyboard alternatives can be implemented ex. add/edit popup. In case of the Scheduler and Timeline the onCellClick event is not fired when using the keyboard 2.1.4 Character Key Shortcuts A Not Applicable - 2.2 Enough Time 2.2.1 Timing Adjustable A Not applicable - 2.2.2 Pause, Stop, Hide A Not Applicable - 2.2.3 No Timing AAA Supported - 2.2.4 Interruptions AAA Not Applicable - 2.2.5 Re-authenticating AAA Not Applicable - 2.2.6 Timeouts AAA Not Applicable - 2.3 Seizures and Physical Reactions 2.3.1 Three Flashes or Below Threshold A Supported - 2.3.2 Three Flashes AAA Supported - 2.3.3 Animation from Interactions AAA Not supported Calendar view page change animation, all views navigation popup animation 2.4 Navigable 2.4.1 Bypass Blocks A Not Applicable - 2.4.2 Page Titled A Not Applicable - 2.4.3 Focus Order A Supported - 2.4.4 Link Purpose (In Context) A Not Applicable - 2.4.5 Multiple Ways AA Not Applicable - 2.4.6 Headings and Labels AA Supported event structure ex. title, time, etc. 2.4.7 Focus Visible AA Supported - 2.4.8 Location AAA Not Applicable - 2.4.9 Link Purpose (Link Only) AAA Not Applicable - 2.4.10 Section Headings AAA Not Applicable - 2.4.11 Focus Not Obscured (Minimum) AA Supported - 2.4.12 Focus Not Obscured (Enhanced) AAA Supported - 2.4.13 Focus Appearance AAA Not supported - 2.5 Input Modalities 2.5.1 Pointer Gestures A Supported - 2.5.2 Pointer Cancellation A Supported - 2.5.3 Label in Name A Supported - 2.5.4 Motion Actuation A Not Applicable - 2.5.5 Target Size (Enhanced) AAA Not fully supported exception the resize handle 2.5.6 Concurrent Input Mechanisms AAA Supported - 2.5.7 Dragging Movements AA Supported D&D works with mouse and touch control but keyboard alternatives can be implemented ex. add/edit popup 2.5.8 Target Size (Minimum) AA Not fully supported exception the resize handle ### [3. Understandable](https://www.w3.org/TR/WCAG22/#understandable) Information and the operation of user interface must be understandable. Guidelines Level Compatibility 3.1 Readable 3.1.1 Language of Page A Not Applicable 3.1.2 Language of Parts AA Not Applicable 3.1.3 Unusual Words AAA Not Applicable 3.1.4 Abbreviations AAA Supported 3.1.5 Reading Level AAA Not Applicable 3.1.6 Pronunciation AAA Not Applicable 3.2 Predictable 3.2.1 On Focus A Supported 3.2.2 On Input A Not Applicable 3.2.3 Consistent Navigation AA Not Applicable 3.2.4 Consistent Identification AA Not Applicable 3.2.5 Change on Request AAA Not Applicable 3.2.6 Consistent Help A Not Applicable 3.3 Input Assistance 3.3.1 Error Identification A Not Applicable 3.3.2 Labels or Instructions A Not Applicable 3.3.3 Error Suggestion AA Not Applicable 3.3.4 Error Prevention (Legal, Financial, Data) AA Not Applicable 3.3.5 Help AAA Not Applicable 3.3.6 Error Prevention (All) AAA Not Applicable 3.3.7 Redundant Entry A Not Applicable 3.3.8 Accessible Authentication (Minimum) AA Not Applicable 3.3.9 Accessible Authentication (Enhanced) AAA Not Applicable ### [4. Robust](https://www.w3.org/TR/WCAG22/#robust) Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. Guidelines Level Compatibility 4.1 Compatible 4.1.1 Parsing (Obsolete and removed) - - 4.1.2 Name, Role, Value A Supported 4.1.3 Status Messages AA Not Applicable --- ## Agenda # Agenda The [Agenda](https://demo.mobiscroll.com/agenda) displays a [list of events for a given period of time](https://demo.mobiscroll.com/agenda/daily-weekly-monthly-annual-agenda#) (year, month, week or day). It can be used as a [standalone component](https://demo.mobiscroll.com/agenda/full-event-customization#) or in [combination with the calendar](https://demo.mobiscroll.com/agenda/navigate-from-external-calendar#). ## Overview The agenda supports a [configurable range listing](https://demo.mobiscroll.com/agenda/daily-weekly-monthly-annual-agenda#) along with daily, monthly and yearly presets. The capabilities like [recurring events](/vue/core-concepts/recurrence), [all-day, multi-day events](#opt-data), [responsiveness](#responsiveness) are supported by agenda. ![Agenda overview](/img/v6/agenda-overview.png) ## Showing the Agenda ### View combination The four views - [scheduler](./scheduler), [calendar](./calendar), [timeline](./timeline), [agenda](./agenda) - can be used alone or combined with each-other to create the perfect user experience on mobile, desktop and on everything in-between. For example, you can combine [a daily agenda with a weekly calendar](https://demo.mobiscroll.com/agenda/daily-agenda-with-week-calendar#) for listing the events for the selected day. The view option will look like the following: ```html title='Daily Agenda combined with Weekly Calendar' ``` ### Configuring the view The Agenda view can be configured through the `view` option. Below are listed the `agenda` object properties which can help you fine-tune this view. ```html title='Example' ``` ### scrollable boolean When set to `true`, makes the event listing 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. ::: ### showEmptyDays boolean Display the day headers for every day in the list, even for those without events. **Default value**: `false` ### size number Specifies the number of years, months, weeks or days included in the list (depending on the specified type). **Default value**: `1` ### type "month" | "day" | "year" | "week" 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`. **Default value**: `'month'` ## Responsiveness The agenda is [fully responsive](https://demo.mobiscroll.com/eventcalendar/responsive-month-view). It adapts to the available space and fills the screen to look good everywhere. While you don't have to worry about the width the height can be manually adjusted with the [height](#opt-height) option. This 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. Use the [responsive](#opt-responsive) option to configure how the calendar behaves on different sized screens. The responsive option is equipped with five breakpoints: - `xsmall` (up to 575px), - `small` (up to 767px), - `medium` (up to 991px), - `large` (up to 1199px), - `xlarge` (from 1200px). Also, custom breakpoints can be added if necessary: - `my-custom-breakpoint: { breakpoint: 600 }` (from 600px up to the next breakpoint). :::info The available width is queried from the container element of the component and not the browsers viewport like in css media queries. ::: ```html title='Responsive configuration with the view option' ``` ![Agenda responsive behavior](/img/v6/agenda-responsive.gif) ## Templating The display of Agenda can be customized with different [solt functions](#slots). ### The event Customize the events that appear on the agenda with the [agendaEvent](#slot-agendaEvent) option. It should return the markup of the event. The event calendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you. Check out how you can style events in [this example](https://demo.mobiscroll.com/vue/agenda/full-event-customization#) or just play with the slider below to see the differences. ### The event content Customize the event content that appears on the agenda by using the [agendaEventContent](#slot-agendaEventContent) option. The event calendar will take care of styling and you can focus on what you show inside of the event. Check out how you can style event content in [this example](https://demo.mobiscroll.com/vue/agenda/event-content-customization#) or just play with the slider below to see the differences. ### The agenda header Customize how the header of the event calendar looks and how the components are arranged with the [header](#slot-header) option. It takes a function that should return the desired markup. In the returned markup, you can use custom html as well as the built in header components of the calendar. While fully customizing the header is very usefull, sometimes it's desireable to customize only parts of it. In this case you can take advantage of the default header's [building blocks](/vue/eventcalendar/templating#header-templating). These components let you put toghether the header you want, while you don't have to worry about the functionality behind them. Check out how you can style the header in [this example](https://demo.mobiscroll.com/vue/agenda/customizing-header#) or just play with the slider below to see the differences. ### The agenda day header Customize the day headers that appear on the agenda with the [agendaDay](#slot-agendaDay) option. It should contain the markup for the day header. Check out how you can style the day headers in [this example](https://demo.mobiscroll.com/vue/agenda/customizing-day-header#) or just play with the slider below to see the differences. ### The agenda empty state Customize the look of the empty state through [agendaEmpty](#slot-agendaEmpty) function. Give a more purposeful feedback to the user and optionally add further actions to it. The template can be totally custom or dynamic based on any criteria. Check out how you can style the empty state in [this example](https://demo.mobiscroll.com/vue/agenda/empty-state#) or just play with the slider below to see the differences. ## Event order When rendering events, the following default order is applied: - All-day events are placed at the top. - Non-all-day events follow, sorted by their start times. - Events with the same start time are ordered alphabetically by their titles. To modify the default event order, you can use the `order` property of the [event data](#opt-data). If the order property does not meet your requirements, the [eventOrder](#opt-eventOrder) option can be used to further customize the ordering, which expects a function that compares two events and returns an order (-1 or 1). ## API Here is a comprehensive list of all the specific options, events and methods of the Agenda view. ### Options Explore the following API options that help you easily configure the Agenda. ### 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` ### context string | HTMLElement The DOM element in which the popups (event popover, year and month picker) are rendered. Can be a selector string or a DOM element. **Default value**: `'body'` ### cssClass string Specifies a custom CSS class for the component. **Default value**: `undefined` ### data Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> The events for the Eventcalendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::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-onEventClick) event will receive the event object as argument, containing the custom properties as well. ::: :::info Use the [getEvents](#method-getEvents) method to get the events between two dates. ::: ```js 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](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. If not specified, it defaults to the [displayTimezone](#opt-displayTimezone). **Default value**: `undefined` ### defaultSelectedDate [MbscDateType](#type-MbscDateType) Specifies the initial selected date on the calendar. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. **Default value**: `undefined` ### displayTimezone string The timezone in which the data is displayed. :::info When using timezones, the [exclusiveEndDates](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. **Default value**: `'local'` ### eventOrder (event1: [MbscCalendarEvent](#type-MbscCalendarEvent), event2: [MbscCalendarEvent](#type-MbscCalendarEvent)) => number Determines the ordering of the events within the same day. Can be a function that accepts two event objects as arguments and should return -1 or 1. If not specified, the default order is: - all day events - rest of events, sorted by start time; events with identical start times, will be ordered alphabetically based on their title **Default value**: `undefined` ### 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`. ::: ### 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` ### max [MbscDateType](#type-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](#opt-invalid) option with daily recurrence starting from the specific date. **Default value**: `undefined` ### min [MbscDateType](#type-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](#opt-invalid) option with daily recurrence until the specific date. **Default value**: `undefined` ### modules Array Additional modules can be added to the eventcalendar. The option receives an array of module objects. For example, the print module can be added through this option. ```js // import the print module import { print } from '@mobiscroll/print'; // later on, add it to the modules array: modules: [print] ``` ### refDate [MbscDateType](#type-MbscDateType) Specifies the reference date for the view calculation, when multiple days, weeks, months or years are displayed. If not specified, will be today's date. It denotes the reference point when calculating the pages going in the future and in the past. For example if the view type is day, the view size is 3, and the current date is `01/16/2024`, the pages are calculated from this date, so the initial page will contain `[01/16/2024, 01/16/2024, 01/17/2024]`, the next page `[01/18/2024, 01/19/2024, 01/20/2024]` and so on. In case of day view, the reference point will be exactly the specified date. For week, month and year views the reference point will be the start of the week, month or year of the specified day. Changing the reference date will not navigate the calendar to the specified date, it only recalculates the pages from the new reference date. To navigate the view to a specified date and time, use the [selectedDate](#opt-selectedDate) option. **Default value**: `undefined` ### responsive [MbscResponsiveOptions](#type-MbscResponsiveOptions) 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, you can use multiple, but each must have a unique name 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](#type-MbscDateType) Specifies the selected date on the calendar. This can be changed programmatically and when changed the calendar will automatically navigate to the specified date. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. This does not change the reference date that defines the reference point of the navigation pages. To change the reference point for the navigation (e.g. start the paging from the newly selected date) use the [refDate](#opt-refDate) option. You also need to pass a handler for the [onSelectedDateChange](#event-onSelectedDateChange) event to update the selected date when the date is changed from the calendar. **Default value**: `undefined` ### selectedEvents Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Specifies the selected events on the calendar. The [onSelectedEventsChange](#event-onSelectedEventsChange) event will be fired when the selected events change from the calendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. **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` ### showEventBuffer boolean If `true`, it will display the event buffers defined in the [event data](#opt-data). **Default value**: `true` ### showEventTooltip boolean If `false`, it will hide the native tooltip that shows up when hovering over an event. **Default value**: `true` ### 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](../theming/sass-variables) or [create custom themes](../theming/sass-themes). :::info Make sure that the theme you set is included in the downloaded package. ::: **Default value**: `undefined` ### themeVariant "light" | "dark" | "auto" Controls which variant of the [theme](#opt-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 [MbscTimezonePlugin](#type-MbscTimezonePlugin) 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](https://momentjs.com/timezone/) and [luxon](https://moment.github.io/luxon/#/). You can specify either the [dataTimezone](#opt-dataTimezone) or the [displayTimezone](#opt-displayTimezone) or both. Depending on which external library you use you can pass either the `momentTimezone`, `dayjsTimezone` or `luxonTimezone` objects. These objects can be imported from the mobiscroll bundle. **Default value**: `undefined` The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - ### width string | number Sets the width of the component. **Default value**: `undefined` ### Events The Agenda ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code. ### @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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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* - The deleted events in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicker, if [slots](#opt-slots) are set. - `slotObj`: *MbscResource* - The resource where the event was clicker, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event is hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the 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. ### @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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `month`: *Date* - The first day of the visible month in case of month view. - inst - The component instance. ### @selected-date-change (args: MbscSelectedDateChangeEvent, inst: EventcalendarBase) => void Triggered when the selected date is changed, e.g. by clicking on a day on a calendar view, or by using the navigation arrows. You can use this event in conjunction with the [selectedDate](#opt-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](#opt-selectMultipleEvents) is enabled. You can also select events programmatically using the [selectedEvents](#opt-selectedEvents) option. Parameters: - args - The event argument with the following properties: - `events`: *Array* - The selected events. - inst - The component instance. ### Localization The Agenda is fully localized. This covers date and time format, button copy, rtl and more. ### 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](#localization-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](#localization-dateFormat) option. **Default value**: `'D DDD MMM YYYY'` ### dayNames Array The list of long day names, starting from Sunday. **Default value**: `['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']` ### dayNamesMin Array The list of minimal day names, starting from Sunday. **Default value**: `['S', 'M', 'T', 'W', 'T', 'F', 'S']` ### dayNamesShort Array The list of abbreviated day names, starting from Sunday. **Default value**: `['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']` ### firstDay number Set the first day of the week: Sunday is 0, Monday is 1, etc. **Default value**: `0` ### locale [MbscLocale](#type-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](https://mobiscroll.com/docs/core-concepts/localization#language-modules). 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 The list of full month names. **Default value**: `['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']` ### monthNamesShort Array The list of abbreviated month names. **Default value**: `['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']` ### 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'` ### 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'` ### Slots The display of Agenda can be customized with different slot functions. ### agenda ```html ``` Customize the agenda listing. Available parameters: - `events`: _Array_ - 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_ - 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. ### agendaDay ```html ``` Customize the day cells of the agenda view. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - The list of events for the day. ### agendaEmpty ```html ``` Customize the agenda listing when the list is empty. ### agendaEvent ```html ``` Customize the events that appear on the agenda. 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 [agendaEventContent](#slot-agendaEventContent) 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. ### agendaEventContent ```html ``` Customize the event content that appears on the agenda. 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 [agendaEvent](#slot-agendaEvent) 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 ```html ``` Customize the header of the event calendar. You can use custom markup and the built in header components of the calendar. ### Types ### MbscCalendarEvent Interface Properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. ### MbscDateType string | Date | object ### MbscLocale Interface Properties: - `allDayText`: *string* - `amText`: *string* - `calendarSystem`: *MbscCalendarSystem* - `cancelText`: *string* - `clearText`: *string* - `closeText`: *string* - `dateFormat`: *string* - `dateFormatFull`: *string* - `dateFormatLong`: *string* - `dateText`: *string* - `dateWheelFormat`: *string* - `dayNames`: *Array* - `dayNamesMin`: *Array* - `dayNamesShort`: *Array* - `daySuffix`: *string* - `dayText`: *string* - `eventText`: *string* - `eventsText`: *string* - `filterEmptyText`: *string* - `filterPlaceholderText`: *string* - `firstDay`: *number* - `fromText`: *string* - `hourText`: *string* - `minuteText`: *string* - `monthNames`: *Array* - `monthNamesShort`: *Array* - `monthSuffix`: *string* - `monthText`: *string* - `moreEventsPluralText`: *string* - `moreEventsText`: *string* - `nextMonthText`: *string* - `nextYearText`: *string* - `noEventsText`: *string* - `nowText`: *string* - `pmText`: *string* - `prevMonthText`: *string* - `prevYearText`: *string* - `rangeEndHelp`: *string* - `rangeEndLabel`: *string* - `rangeStartHelp`: *string* - `rangeStartLabel`: *string* - `rtl`: *boolean* - `secondText`: *string* - `selectedPluralText`: *string* - `selectedText`: *string* - `setText`: *string* - `timeFormat`: *string* - `timeText`: *string* - `timeWheels`: *string* - `toText`: *string* - `todayText`: *string* - `weekText`: *string* - `yearSuffix`: *string* - `yearText`: *string* ### MbscRecurrenceRule Interface Properties: - `count`: *number* - `day`: *number | Array* - `from`: *[MbscDateType](#type-MbscDateType)* - `interval`: *number* - `month`: *number | Array* - `pos`: *number* - `repeat`: *"daily" | "weekly" | "monthly" | "yearly"* - `until`: *[MbscDateType](#type-MbscDateType)* - `weekDays`: *string* - `weekStart`: *string* ### MbscResponsiveOptions Interface The `MbscResponsiveOptions` supports custom properties in the form: ``` [key:string]: MbscEventcalendarOptions & {breakpoint?: number} ``` The keys are the names of the breakpoints, and the values are objects containing the options for the given breakpoint. The `breakpoint` property, when present, specifies the min-width in pixels. The options will take into effect from that width. :::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 ### MbscTimezonePlugin Interface Properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* --- ## Eventcalendar API Here is a comprehensive list of all the options, events and method the Eventcalendar has. ## Options Explore the following API options that help you easily configure the Eventcalendar. ### 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](#opt-dragToCreate) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-eventDelete) option. **Default value**: `undefined` ### colors Array<[MbscCalendarColor](#type-MbscCalendarColor)> Specifies the color for certain dates or date ranges on the calendar. The [`MbscCalendarColor`](#type-MbscCalendarColor) type 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. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. :::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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The colors can be combined with the [labels](#opt-labels) or [marked](#opt-marked) options. ::: ```js [ { 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](#type-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 [`MbscEventConnection`](#type-MbscEventConnection) type has the following properties: - `arrow`: *boolean | "from" | "to" | "bidirectional"* - Specifies where to display arrows If `true`, the arrow will display only at the end side of the connection. - `color`: *string* - Specifies the color of the connection. - `cssClass`: *string* - Custom CSS class for the connection line for further customization. - `from`: *string | number* - The id of the event where the connection will begin - `to`: *string | number* - The id of the event where the connection will end. - `type`: *"fs" | "sf" | "ss" | "ff"* - The type of the connection. Possible values: `'fs'` - finish-to-start, `'sf'` - start-to-finish, `'ss'` - start-to-start, `'ff'` - finish-to-finish. **Default value**: `undefined` ### context string | HTMLElement The DOM element in which the popups (event popover, year and month picker) are rendered. Can be a selector string or a DOM element. **Default value**: `'body'` ### cssClass string Specifies a custom CSS class for the component. **Default value**: `undefined` ### data Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> The events for the Eventcalendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::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-onEventClick) event will receive the event object as argument, containing the custom properties as well. ::: :::info Use the [getEvents](#method-getEvents) method to get the events between two dates. ::: ```js 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](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. If not specified, it defaults to the [displayTimezone](#opt-displayTimezone). **Default value**: `undefined` ### defaultSelectedDate [MbscDateType](#type-MbscDateType) Specifies the initial selected date on the calendar. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. **Default value**: `undefined` ### displayTimezone string The timezone in which the data is displayed. :::info When using timezones, the [exclusiveEndDates](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), 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](#opt-dragInTime) option. Consider that [dragToMove](#opt-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](#opt-dragInTime) option. Consider that [dragToMove](#opt-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](#opt-dragBetweenResources) option. Consider that [dragToMove](#opt-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` ### dragTimeStepBase "viewStart" | "dayStart" Specifies the base of the [dragTimeStep](#opt-dragTimeStep) calculation. If set to `'viewStart'` it takes the `startTime` property of the [view](#opt-view) option as reference. **Default value**: `'dayStart'` ### 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](#opt-newEventText) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-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](#opt-clickToCreate) and [dragToCreate](#opt-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](#type-MbscCalendarEvent), event2: [MbscCalendarEvent](#type-MbscCalendarEvent)) => number Determines the ordering of the events within the same day. Can be a function that accepts two event objects as arguments and should return -1 or 1. If not specified, the default order is: - all day events - rest of events, sorted by start time; events with identical start times, will be ordered alphabetically based on their title **Default value**: `undefined` ### 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) => void | [MbscCalendarEvent](#type-MbscCalendarEvent) Use this option to set properties to the new event created with click or drag. The event creation is handled by the [clickToCreate](#opt-clickToCreate) and [dragToCreate](#opt-dragToCreate) options. It takes a function that should return the properties for the new event. The argument object passed to this function has the following properties: - `start`: *Date* - The date when the newly created event will start. - `resource`: *string | number* - The id of the resource where the event creation started. ```js extendDefaultEvent: (args) => { return { color: args.resource === 'admin' ? 'green' : 'red', title: 'My event', }; } ``` **Default value**: `undefined` ### 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` ### externalResourceDrag boolean If `true`, external drag & drop is allowed and resource can be dragged outside of the component view. **Default value**: `undefined` ### externalResourceDrop boolean If `true`, external resources can be dragged into the view. **Default value**: `undefined` ### groupBy "date" | "resource" Groups the [events](#opt-data) by date or by [resource](#opt-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](#type-MbscDateType)> | Array<[MbscCalendarInvalid](#type-MbscCalendarInvalid)> 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* - 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* - Specifies the [resource](#opt-resources) 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](#opt-slots) 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. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: ```js [ // 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` The [`MbscCalendarInvalid`](#type-MbscCalendarInvalid) type has the following properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### invalidateEvent "start-end" | "strict" Specifies how to validate events against [invalid](#opt-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](#type-MbscCalendarLabel)> Specifies labels for calendar days. The [`MbscCalendarLabel`](#type-MbscCalendarLabel) type has the following properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the label. - `cssClass`: *string* - Specifies a custom CSS class that is applied to the label. - `date`: *string | object | Date* - Specifies a single date for the label - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the label - `order`: *number* - Specifies the order of the label in the array. Has precedence over the default ordering rules. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the label - `textColor`: *string* - A color applied on the text. - `title`: *string* - The title of the label. - `tooltip`: *string* - Tooltip for the label :::info The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The labels can be combined with the [colors](#opt-colors) option. ::: ```js [ { 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](#type-MbscCalendarMarked)> Mark certain dates on the calendar. An array containing dates, or objects with the following properties: The [`MbscCalendarMarked`](#type-MbscCalendarMarked) type has the following properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Color of the mark. - `date`: *string | object | Date* - Specifies a single date when this is applicable - `end`: *string | object | Date* - Specifies the end date/time of a date/time range when this is applicable - `markCssClass`: *string* - CSS class for the mark. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range when this is applicable - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. :::info The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The marked days can be combined with the [colors](#opt-colors) option. ::: ```js [ 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](#type-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](#opt-invalid) option with daily recurrence starting from the specific date. **Default value**: `undefined` ### min [MbscDateType](#type-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](#opt-invalid) option with daily recurrence until the specific date. **Default value**: `undefined` ### modules Array Additional modules can be added to the eventcalendar. The option receives an array of module objects. For example, the print module can be added through this option. ```js // import the print module import { print } from '@mobiscroll/print'; // later on, add it to the modules array: modules: [print] ``` ### refDate [MbscDateType](#type-MbscDateType) Specifies the reference date for the view calculation, when multiple days, weeks, months or years are displayed. If not specified, will be today's date. It denotes the reference point when calculating the pages going in the future and in the past. For example if the view type is day, the view size is 3, and the current date is `01/16/2024`, the pages are calculated from this date, so the initial page will contain `[01/16/2024, 01/16/2024, 01/17/2024]`, the next page `[01/18/2024, 01/19/2024, 01/20/2024]` and so on. In case of day view, the reference point will be exactly the specified date. For week, month and year views the reference point will be the start of the week, month or year of the specified day. Changing the reference date will not navigate the calendar to the specified date, it only recalculates the pages from the new reference date. To navigate the view to a specified date and time, use the [selectedDate](#opt-selectedDate) option. **Default value**: `undefined` ### resources null | Array<[MbscResource](#type-MbscResource)> The scheduler and timeline views can handle multiple resources. Resource grouping can be modified with the help of the [groupBy](#opt-groupBy) option. If set to `null` or `undefined`, all events will be displayed, regardless of their `resource` property. The timeline view will not display the resource column, if the resources option is not set. If set to an empty array, only those events will be displayed which are not tied to any resource. The timeline view will display an empty resource column when an empty array is passed. The timeline view can render multiple levels of hierarchy groups. Levels can be added with the help of the `children` property. The [`MbscResource`](#type-MbscResource) type has the following properties: - `background`: *string* - Specifies the background color of the resource row or column. - `children`: *Array<[MbscResource](#type-MbscResource)>* - Child resources. - `collapsed`: *boolean* - Specifies the displayed state of the child resource group. - `color`: *string* - Specifies the default event color 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. - `cssClass`: *string* - Specifies a css class for the resource row or column. - `eventCreation`: *boolean* - Disables event creation on specific resources by setting it to false. Defaults to true. - `eventDragBetweenResources`: *boolean* - Specifies whether the events in this resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the [dragBetweenResources](#opt-dragBetweenResources) option. - `eventDragBetweenSlots`: *boolean* - Specifies whether the events in this slot are movable across slots. Has precedence over the [dragBetweenSlots](#opt-dragBetweenSlots) option. - `eventDragInTime`: *boolean* - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventOverlap`: *boolean* - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize`: *boolean* - Specifies whether the events in this resource are resizable. Has precedence over the [dragToResize](#opt-dragToResize) option. - `fixed`: *boolean* - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-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 dra & rop and event creation functionalities to work properly. - `id`: *string | number* - The id of the resource. - `name`: *string* - Specifies the name of the resource. - `reorder`: *boolean* - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. ```js 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 [MbscResponsiveOptions](#type-MbscResponsiveOptions) 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, you can use multiple, but each must have a unique name 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](#type-MbscDateType) Specifies the selected date on the calendar. This can be changed programmatically and when changed the calendar will automatically navigate to the specified date. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. This does not change the reference date that defines the reference point of the navigation pages. To change the reference point for the navigation (e.g. start the paging from the newly selected date) use the [refDate](#opt-refDate) option. You also need to pass a handler for the [onSelectedDateChange](#event-onSelectedDateChange) event to update the selected date when the date is changed from the calendar. **Default value**: `undefined` ### selectedEvents Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Specifies the selected events on the calendar. The [onSelectedEventsChange](#event-onSelectedEventsChange) event will be fired when the selected events change from the calendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. **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` ### showEventBuffer boolean If `true`, it will display the event buffers defined in the [event data](#opt-data). **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](#type-MbscSlot)> The slots, besides the [resources](#opt-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 [`MbscSlot`](#type-MbscSlot) type has the following properties: - `eventDragBetweenSlots`: *boolean* - Specifies whether the event is movable across slots. - `id`: *string | number* - The id of the slot. It that can be referenced in the events/invalids/colors data. - `name`: *string* - The name of the slot that will be displayed at the top of the slot column. ```js 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](../theming/sass-variables) or [create custom themes](../theming/sass-themes). :::info Make sure that the theme you set is included in the downloaded package. ::: **Default value**: `undefined` ### themeVariant "light" | "dark" | "auto" Controls which variant of the [theme](#opt-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 [MbscTimezonePlugin](#type-MbscTimezonePlugin) 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](https://momentjs.com/timezone/) and [luxon](https://moment.github.io/luxon/#/). You can specify either the [dataTimezone](#opt-dataTimezone) or the [displayTimezone](#opt-displayTimezone) or both. Depending on which external library you use you can pass either the `momentTimezone`, `dayjsTimezone` or `luxonTimezone` objects. These objects can be imported from the mobiscroll bundle. **Default value**: `undefined` The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - ### view [MbscEventcalendarView](#type-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. - `eventDisplay`: *'fill' | 'exact'* (default 'fill') - Specifies how events are displayed. - If set to `'exact'`, events are displayed according to their start and end times. - If set to `'fill'`, events cover the entire day. - `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](#opt-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. ::: - `showEmptyDays`: *boolean* (default `false`) - When set to `true`, it will display day headers for every day in the list, even for those without events. `scheduler`: 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`) - Specifies the first visible weekday of the view. Sunday is 0, Monday is 1, etc. Days outside of the `startDay` and `endDay` range will not be visible. Should not be mistaken for the [firstDay](#localization-firstDay) option, which sets the first day of the week, and, if not set, is defined by the [localization](#localization-locale). - `endDay`: *number* (default `6`) - Specifies the last visible weekday of the view. Sunday is 0, Monday is 1, etc. - `startTime`: *string* (default `'00:00'`) - Set the start time of scheduler column. Hours, minutes and an optional negative day offset can be specified in the same string. - Standard format: 'HH:MM' (e.g., `'09:30'`). - Offset format (initiates the view N days prior): 'HH:MM-N' (e.g., `'20:00-1'`). - `endTime`: *string* (default `'24:00'`) - Set the end time of scheduler column. Hours, minutes and an optional positive day offset can be specified in the same string. - Standard format: 'HH:MM' (e.g., `'18:30'`). - Offset format (extends the view N days after): 'HH:MM+N' (e.g., `'08:00+1'`). - `hideEmptyColumns`: *boolean* (default `false`) - Hide the empty columns in the scheduler view. If set to `true`, the scheduler will not display columns without events. - `hideInvalidColumns`: *boolean* (default `false`) - Hide the fully invalid columns in the scheduler view. If set to `true`, the scheduler will not display fully invalid columns. - `maxEventStack`: *'all' | 'auto' | number* - Limit the number of displayed events. When the number of overlapping events reaches the specified value, a "more" button will be displayed which opens a popover showing the rest of the events. - If it is a `number`, it specifies how many events will be displayed before the "more" button appears. - If set to `'all'`, all events will be displayed. - If set to `'auto'`, the component will decide how many events can be placed inside the column, based on the `minEventWidth` view option and the actual column width. - `minEventWidth`: *number* - Specifies the minimum event width. Will be used when `maxEventStack: 'auto'` is used. - `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* - 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](https://gist.github.com/aviflax/a4093965be1cd008f172). If no label is provided, the time column label will be UTC +/- the timezone offset. ```js timezones: ['Europe/Berlin','Europe/Bucharest'] ``` ```js timezones: [ { timezone: 'America/Chicago', label: 'CHI'}, { timezone: 'America/New_York', label: 'NY'} ] ``` - `virtualScroll`: *boolean* (default `true`) - Enable or disable virtual scroll. `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. - `hideEmptyRows`: *boolean* (default `false`) - Hide the empty rows in the timeline view. If set to `true`, the timeline will not display rows without events. :::info Parent resources will always be displayed, even when empty. ::: - `hideInvalidRows`: *boolean* (default `false`) - Hide the fully invalid rows in the timeline view. If set to `true`, the timeline will not display the fully invalid rows. :::info Parent resources will always be displayed, even when fully invalid. ::: - `startDay`: *number* (default `0`) - Specifies the first visible weekday of the view. Sunday is 0, Monday is 1, etc. Days outside of the `startDay` and `endDay` range will not be visible. Should not be mistaken for the [firstDay](#localization-firstDay) option, which sets the first day of the week, and, if not set, is defined by the [localization](#localization-locale). - `endDay`: *number* (default `6`) - Specifies the last visible weekday of the view. Sunday is 0, Monday is 1, etc. - `maxEventStack`: *'all' | number* - Limit the number of displayed events. When the number of overlapping events reaches the specified value, a "more" button will be displayed which opens a popover showing the rest of the events. - If it is a `number`, it specifies how many events will be displayed before the "more" button appears. - If set to `'all'`, all events will be displayed. - `startTime`: *string* (default `'00:00'`) - Set the start time of the timeline days. Hours, minutes and an optional negative day offset can be specified in the same string. - Standard format: 'HH:MM' (e.g., `'09:30'`). - Offset format (initiates the view N days prior - supported only for single day view): 'HH:MM-N' (e.g., `'20:00-1'`). - `endTime`: *string* (default `'24:00'`) - Set the end time of the timeline days. Hours, minutes and an optional positive day offset can be specified in the same string. - Standard format: 'HH:MM' (e.g., `'18:30'`). - Offset format (extends the view N days after - supported only for single day view): 'HH:MM+N' (e.g., `'08:00+1'`). - `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. - `eventDisplay`: *'fill' | 'exact'* (default 'exact') - Specifies how events are displayed. - If set to `'exact'`, events are displayed according to their start and end times. - If set to `'fill'`, events cover the entire cell. - `eventHeight`: *'variable' | 'equal'* (default 'equal') - Specifies wether the height of the events is equal or variable. :::info [Learn more about variable event heights](./timeline#variable-event-height). ::: - `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. ```js view: { calendar: { type: 'week', size: 2 }, agenda: { type: 'week', size: 2 } } ``` ### width string | number Sets the width of the component. **Default value**: `undefined` ### zoomLevel string | number Specifies the current zoom level of the timeline view. The zoom levels can be listed using the `zoomLevels` property of the timeline inside the view option. **Default value**: `undefined` ## Events The Eventcalendar ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code. ### @cell-click (args: MbscCellClickEvent, inst: EventcalendarBase) => void Triggered when a cell is clicked on the calendar view, scheduler grid, or timeline grid. 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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 view, scheduler grid, 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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 on a calendar day, scheduler cell, or timeline cell. Parameters: - args - The event argument with the following properties: - `colors`: *Array* - The colors for the hovered cell. - `date`: *Date* - The date of the hovered day. - `events`: *Array* - The events for the hovered cell. - `invalids`: *Array* - The invalid dates for the hovered cell. - `labels`: *Array* - If the cell has labels, contains the label objects for the hovered cell. - `marked`: *Array* - If the cell is marked, contains the marked objects for the hovered cell. - `selected`: *boolean* - Specifies if the cell is currently selected or not (in case of calendar view). - `target`: *HTMLElement* - The DOM element of the cell. - `resource`: *MbscResource* - The resource object for the hovered cell. - inst - The component instance. ### @cell-hover-out (args: MbscCellHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer leaves a calendar day, scheduler cell, or timeline cell. Parameters: - args - The event argument with the following properties: - `colors`: *Array* - The colors for the hovered cell. - `date`: *Date* - The date of the hovered cell. - `events`: *Array* - The events for the hovered cell. - `invalids`: *Array* - The invalid dates for the hovered cell. - `labels`: *Array* - If the cell has labels, contains the label objects for the hovered cell. - `marked`: *Array* - If the cell is marked, contains the marked objects for the hovered cell. - `selected`: *boolean* - Specifies if the cell is currently selected or not (in case of calendar view). - `target`: *HTMLElement* - The DOM element of the cell. - `resource`: *MbscResource* - The resource object for the hovered cell. - inst - The component instance. ### @cell-right-click (args: MbscCellClickEvent, inst: EventcalendarBase) => void Triggered when a cell is right-clicked on the calendar view, scheduler grid, 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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. - `resourceObj`: *MbscResource* - The resource where the event is being created, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is being created, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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' | 'scheduler'* - 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' | 'scheduler'* - The view where the event was created. - `target`: *HTMLElement* - The DOM element of the created event. - `resourceObj`: *MbscResource* - The resource where the event is being created, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is being created, if [slots](#opt-slots) are set. - 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* - The events being deleted in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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* - The deleted events in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicker, if [slots](#opt-slots) are set. - `slotObj`: *MbscResource* - The resource where the event was clicker, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was dragged, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was dragged, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was dragged, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'scheduler' | '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/scheduler 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' | 'scheduler' | '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/scheduler 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' | 'scheduler' | '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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is dragged, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is dragged, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is dragged, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'scheduler' | '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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event is hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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* - The updated events. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) 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* - The original events before the update. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) 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. - `oldResource`: number | string - The id of the resource from which the event was dragged. - `oldResourceObj`: *MbscResource* - The resource from which the event was dragged. - `oldSlot`: number | string - The id of the slot from which the event was dragged. - `oldSlotObj`: *MbscSlot* - The slot from which the event was dragged. - `resource`: number | string - The id of the resource where the event was dropped. - `resourceObj`: *MbscResource* - The resource where the event was dropped. - `slot`: number | string - The id of the slot where the event was dropped. - `slotObj`: *MbscSlot* - The slot where the event was dropped. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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' | 'scheduler'* - 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* - The updated events. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) is enabled. - `oldEvent`: *MbscCalendarEvent* - The original event before the update. - `oldEvents`: *Array* - The original events before the update. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) is enabled. - `resourceObj`: *MbscResource* - The resource where the event is updated, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is updated, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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* - 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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `month`: *Date* - The first day of the visible month in case of month view. - inst - The component instance. ### @resource-click (args: MbscResourceClickEvent, inst: EventcalendarBase) => void Triggered when a resource cell is clicked on the scheduler or timeline. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the day on which the resource was clicked, when resources are grouped by day. - `domEvent`: *Event* - The DOM event of the click. - `resource`: *MbscResource* - The resource associated with the clicked cell. - `source`: *'scheduler' | 'timeline'* - The view where the cell was clicked. - `target`: *HTMLElement* - The DOM element of the clicked cell. - 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](#opt-resources). - `resourceObj`: *MbscResource* - The collapsed [resource](#opt-resources). - inst - The component instance. ### @resource-create (args: MbscResourceCreateEvent, inst: EventcalendarBase) => void Triggered when an resource is about to create and it is not yet rendered on its final position. Resource creation 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). - `index`: *number* - The position of the resource within its siblings. - `parent`: *MbscResource* - The parent resource. - `resource`: *MbscResource* - The newly created resource. - inst - The component instance. ### @resource-created (args: MbscResourceCreatedEvent, inst: EventcalendarBase) => void Triggered when a resource is created and it is rendered in its position. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event from the end of the gesture (mouseup or touchend). - `index`: *number* - The position of the resource within its siblings. - `parent`: *MbscResource* - The parent resource. - `resource`: *MbscResource* - The newly created resource. - inst - The component instance. ### @resource-delete (args: MbscResourceDeleteEvent, inst: EventcalendarBase) => void Triggered when an resource is about to be deleted and it is not yet removed from the view. Resource 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 the end of the gesture (mouseup or touchend). - `index`: *number* - The former position of the resource within its siblings. - `parent`: *MbscResource* - The parent resource. - `resource`: *MbscResource* - The resource being deleted. - inst - The component instance. ### @resource-deleted (args: MbscResourceDeletedEvent, inst: EventcalendarBase) => void Triggered when a resource is deleted and it is removed from the view. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event from the end of the gesture (mouseup or touchend). - `index`: *number* - The former position of the resource within its siblings. - `parent`: *MbscResource* - The parent resource. - `resource`: *MbscResource* - The deleted resource. - inst - The component instance. ### @resource-double-click (args: MbscResourceClickEvent, inst: EventcalendarBase) => void Triggered when a resource cell is double-clicked on the scheduler or timeline. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the day on which the resource was clicked, when resources are grouped by day. - `domEvent`: *Event* - The DOM event of the click. - `resource`: *MbscResource* - The resource associated with the clicked cell. - `source`: *'scheduler' | 'timeline'* - The view where the cell was clicked. - `target`: *HTMLElement* - The DOM element of the clicked cell. - inst - The component instance. ### @resource-drag-enter (args: MbscResourceDragEvent, inst: EventcalendarBase) => void Triggered when a resource is dragged into the timeline view. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event of the drag. - `resource`: *MbscResource* - The dragged resource. - inst - The component instance. ### @resource-drag-leave (args: MbscResourceDragEvent, inst: EventcalendarBase) => void Triggered when a resource is dragged out from the timeline view. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event of the drag. - `resource`: *MbscResource* - The dragged 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](#opt-resources). - `resourceObj`: *MbscResource* - The expanded [resource](#opt-resources). - inst - The component instance. ### @resource-hover-in (args: MbscResourceHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer hovers a resource cell on the timeline or scheduler view. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the hovered resource cell in case of group by date. - `resource`: *MbscResource* - The hovered resource. - `source`: *'scheduler' | 'timeline'* - The view where the resource cell was hovered. - `target`: *HTMLElement* - The DOM element of the resource cell. - inst - The component instance. ### @resource-hover-out (args: MbscResourceHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer leaves a resource cell on the timeline or scheduler view. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the hovered resource cell in case of group by date. - `resource`: *MbscResource* - The hovered resource. - `source`: *'scheduler' | 'timeline'* - The view where the resource cell was hovered. - `target`: *HTMLElement* - The DOM element of the resource cell. - inst - The component instance. ### @resource-order-update (args: MbscResourceOrderEvent, inst: EventcalendarBase) => void Triggered after a resource is dragged and dropped into a new location. Resource reorder can be prevented by returning `false` from the handler function. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. Parameters: - args - The event argument with the following properties: - `index`: *Resource* - The new position of the resource within its siblings. - `oldIndex`: *Resource* - The old position of the resource within its siblings. - `oldParent`: *Resource* - The old parent resource. - `parent`: *Resource* - The parent resource. - `resource`: *Resource* - The updated resource. - `resources`: Array<*Resource*> - The entire resources array with the new order. - inst - The component instance. ### @resource-right-click (args: MbscResourceClickEvent, inst: EventcalendarBase) => void Triggered when a resource cell is right-clicked on the scheduler or timeline. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the day on which the resource was clicked, when resources are grouped by day. - `domEvent`: *Event* - The DOM event of the click. - `resource`: *MbscResource* - The resource associated with the clicked cell. - `source`: *'scheduler' | 'timeline'* - The view where the cell was clicked. - `target`: *HTMLElement* - The DOM element of the clicked cell. - inst - The component instance. ### @selected-date-change (args: MbscSelectedDateChangeEvent, inst: EventcalendarBase) => void Triggered when the selected date is changed, e.g. by clicking on a day on a calendar view, or by using the navigation arrows. You can use this event in conjunction with the [selectedDate](#opt-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](#opt-selectMultipleEvents) is enabled. You can also select events programmatically using the [selectedEvents](#opt-selectedEvents) option. Parameters: - args - The event argument with the following properties: - `events`: *Array* - The selected events. - inst - The component instance. ### @virtual-loading (args: MbscVirtualLoadEvent, inst: EventcalendarBase) => void Triggered when a new virtual page is loaded. You can use this to load events and resources on demand while scrolling the timeline and scheduler grid. Parameters: - args - The event argument with the following properties: - `viewStart`: *Date* - The date where the virtual view starts. - `viewEnd`: *Date* - The date where the virtual view end. - `resourceStart`: *number|string* - The id of the resource where the virtual view starts. - `resourceEnd`: *number|string* - The id of the resource where the virtual view ends. - `timeStart`: *number* - The time in milliseconds where the virtual view starts on the scheduler view. - `timeEnd`: *number* - The time in milliseconds where the virtual view ends on the scheduler view. - `oldResourceStart`: *number|string* - The id of the resource where the previous virtual view started. - `oldResourceEnd`: *number|string* - The id of the resource where the previous virtual view ended. - `oldViewStart`: *Date* - The date where the previous virtual view started. - `oldViewEnd`: *Date*- The date where the previous virtual view ended. - `oldTimeStart`: *number* - The time in milliseconds where the previous virtual view started on the scheduler view. - `oldTimeEnd`: *number* - The time in milliseconds where the previous virtual view ended on the scheduler view. - inst - The component instance. ## Localization The Eventcalendar is fully localized. This covers date and time format, button copy, rtl and more. ### 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](#localization-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](#localization-dateFormat) option. **Default value**: `'D DDD MMM YYYY'` ### dayNames Array The list of long day names, starting from Sunday. **Default value**: `['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']` ### dayNamesMin Array The list of minimal day names, starting from Sunday. **Default value**: `['S', 'M', 'T', 'W', 'T', 'F', 'S']` ### dayNamesShort Array 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 [MbscLocale](#type-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](https://mobiscroll.com/docs/core-concepts/localization#language-modules). 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 The list of full month names. **Default value**: `['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']` ### monthNamesShort Array 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](#localization-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](#localization-moreEventsPluralText) as well, if the plural form is different. **Default value**: `'{count} more'` ### newEventText string Title for the newly created event with the [dragToCreate](#opt-dragToCreate) and the [clickToCreate](#opt-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 These methods are actions that can be performed on a component instance. ### getEvents (start: [MbscDateType](#type-MbscDateType), end: [MbscDateType](#type-MbscDateType)) => Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Returns the [events](#opt-data) 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. Parameters: - start - Start date of the specified interval. - end - End date of the specified interval. ### getInvalids (start: [MbscDateType](#type-MbscDateType), end: [MbscDateType](#type-MbscDateType)) => Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Returns the [invalids](#opt-invalid) 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. Parameters: - start - Start date of the specified interval. - end - End date of the specified interval. ### getViewDate () => Date Returns the view date which is representing the currently displayed date on the component. ### navigateToEvent (event: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void Navigates to the specified event on the calendar. Parameters: - event - The event object. The `id`, `start` and `resource` properties (in case if resources are used in timeline or scheduler views) must be present in the object. ## Slots The display of the Eventcalendar can be customized with different slot functions. ### agenda ```html ``` Customize the agenda listing. Available parameters: - `events`: _Array_ - 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_ - 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. ### agendaDay ```html ``` Customize the day cells of the agenda view. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - The list of events for the day. ### agendaEmpty ```html ``` Customize the agenda listing when the list is empty. ### agendaEvent ```html ``` Customize the events that appear on the agenda. 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 [agendaEventContent](#slot-agendaEventContent) 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. ### agendaEventContent ```html ``` Customize the event content that appears on the agenda. 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 [agendaEvent](#slot-agendaEvent) 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. ### bufferAfter ```html ``` Customize the buffer area that is displayed at the end of the scheduler and timeline events. The buffer can be defined with the help of the `bufferAfter` property of the [event data](#opt-data). The template will receive an event object as data. 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. ### bufferBefore ```html ``` Customize the buffer area that is displayed at the start of the scheduler and timeline events. The buffer can be defined with the help of the `bufferBefore` property of the [event data](#opt-data). The template will receive an event object as data. 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. ### calendarDay ```html ``` Customize the day cells of the calendar view. If you are looking to customize only the day cells content and don't want to bother with the styling of the cells, use the [calendarDayContent](#slot-calendarDayContent) option. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `selected`: _boolean_ - True if the date is selected. - `events`: _Array_ - The list of events for the day. ### calendarDayContent ```html ``` Customize the day cells content of the calendar view. 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 [calendarDay](#slot-calendarDay) option. The following properties are available: - `date`: _Date_ - The date of the rendered day. - `selected`: _boolean_ - True if the date is selected. - `events`: _Array_ - The list of events for the day. ### calendarEvent ```html ``` Customize the events 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 event, you can use the [calendarEventContent](#slot-calendarEventContent) 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. ### calendarEventContent ```html ``` Customize the event contents, that appears on the calendar. 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 label (ex. add custom hover effects) you will need to use the [calendarEvent](#slot-calendarEvent) 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. ### cell ```html ``` Customize the cells of the Eventcalendar in scheduler and timeline views. The template will receive an object as context, which can be used to display custom content in the cells. Keep the cell template simple, as it will be called and rendered **very frequently** during scroll and view changes. The object passed to the template contains the following properties: - `colors`: _Array_ - The list of colors for the current cell. - `date`: _Date_ – The current cell's date. - `events`: _Array_ - The list of events for the current cell. - `invalids`: _Array_ - The list of invalids for the current cell. - `resource`: _MbscResource_ – The resource object for the current cell. - `slot`: _MbscSlot_ - The slot object for the current cell. ### dayFooter ```html ``` 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_ - The list of events for the day. ### header ```html ``` Customize the header of the event calendar. You can use custom markup and the built in header components of the calendar. ### hour ```html ``` 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_ - The list of events for the hour. - `isActive`: _boolean_ - True for the current hour. ### hourFooter ```html ``` 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_ - The list of events for the hour. - `isActive`: _boolean_ - True for the current hour. ### month ```html ``` 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_ - The list of events for the month. - `isActive`: _boolean_ - True for the current month. ### monthFooter ```html ``` 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_ - The list of events for the month. - `isActive`: _boolean_ - True for the current month. ### popoverEvent ```html ``` Customize the events that appear on 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 [popoverEventContent](#slot-popoverEventContent) 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. ### popoverEventContent ```html ``` Customize the event content that appears on 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 [popoverEvent](#slot-popoverEvent) 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. ### quarter ```html ``` 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_ - The list of events for the quarter. - `isActive`: _boolean_ - True for the current quarter. ### quarterFooter ```html ``` 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_ - The list of events for the quarter. - `isActive`: _boolean_ - True for the current quarter. ### resource ```html ``` Customize how the resources are rendered on the scheduler and timeline views. The following properties are available: - `resource`: _MbscResource_ - The rendered resource. - `day`: _Date_ - The date on which the resource is rendered. Available when grouping by date in the scheduler view, or when vertical day resolution is used in the timeline view. ### resourceEmpty ```html ``` Customize the content of the resource column in case of an empty resource array. It will receive the following parameter: - `day`: _Date_ - The date on which the resource is rendered in case of vertical day resolution. ### resourceFooter ```html ``` Customize the cell content below the resource column on the timeline view, when the [dayFooter](#slot-dayFooter) option is also used. ### resourceHeader ```html ``` Customize the cell content above the resource column on the timeline view. ### schedulerDay ```html ``` Customize the date header of the scheduler view. If you are looking to customize only the day cells content and don't want to bother with the styling of the cells, use the [schedulerDayContent](#slot-schedulerDayContent) option. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - 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. ### schedulerDayContent ```html ``` Customize the day cells content of the scheduler view. 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 [schedulerDay](#slot-schedulerDay) option. The following properties are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - 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. ### schedulerEvent ```html ``` Customize the events that appear on the scheduler. 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 [schedulerEventContent](#slot-schedulerEventContent) 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. ### schedulerEventContent ```html ``` Customize the event content that appears on the scheduler. 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 [schedulerEvent](#slot-schedulerEvent) 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 ```html ``` Add a custom sidebar on the right side of the timeline. The object of the rendered resource is available for use. It will receive the following parameters: - `resource`: _MbscResource_ - The rendered resource. - `day`: _Date_ - The date on which the resource is rendered in case of vertical day resolution in the timeline view. ### sidebarFooter ```html ``` Customize the cell content below the sidebar column on the timeline view, when the [sidebar](#slot-sidebar) option is also used. ### sidebarHeader ```html ``` Customize the cell content above the sidebar column on the timeline view, when the [sidebar](#slot-sidebar) option is also used. ### slot ```html ``` Customize the [slots](#opt-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. ### timelineDay ```html ``` Customize the date header of the timeline view. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - The list of events for the day. - `isActive`: _boolean_ - True for the current day. ### timelineEvent ```html ``` Customize the events that appear on the 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 [timelineEventContent](#slot-timelineEventContent) 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. ### timelineEventContent ```html ``` Customize the event content that appears on the 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 [timelineEvent](#slot-timelineEvent) 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. ### week ```html ``` 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_ - 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 ```html ``` 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_ - 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 ```html ``` 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_ - The list of events for the year. - `isActive`: _boolean_ - True for the current year. ### yearFooter ```html ``` 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_ - The list of events for the year. - `isActive`: _boolean_ - True for the current year. ## Types ### MbscCalendarColor Interface Properties: - `allDay`: *boolean* - Specifies whether the date you want to color is all day or not. - `background`: *string* - Background color of the cell. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. ### MbscCalendarEvent Interface Properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. ### MbscCalendarInvalid Interface Properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### MbscCalendarLabel Interface Properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the label. - `cssClass`: *string* - Specifies a custom CSS class that is applied to the label. - `date`: *string | object | Date* - Specifies a single date for the label - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the label - `order`: *number* - Specifies the order of the label in the array. Has precedence over the default ordering rules. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the label - `textColor`: *string* - A color applied on the text. - `title`: *string* - The title of the label. - `tooltip`: *string* - Tooltip for the label ### MbscCalendarMarked Interface Properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Color of the mark. - `date`: *string | object | Date* - Specifies a single date when this is applicable - `end`: *string | object | Date* - Specifies the end date/time of a date/time range when this is applicable - `markCssClass`: *string* - CSS class for the mark. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range when this is applicable - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. ### MbscDateType string | Date | object ### MbscEventConnection Interface Properties: - `arrow`: *boolean | "from" | "to" | "bidirectional"* - Specifies where to display arrows If `true`, the arrow will display only at the end side of the connection. - `color`: *string* - Specifies the color of the connection. - `cssClass`: *string* - Custom CSS class for the connection line for further customization. - `from`: *string | number* - The id of the event where the connection will begin - `to`: *string | number* - The id of the event where the connection will end. - `type`: *"fs" | "sf" | "ss" | "ff"* - The type of the connection. Possible values: `'fs'` - finish-to-start, `'sf'` - start-to-finish, `'ss'` - start-to-start, `'ff'` - finish-to-finish. ### MbscEventcalendarView Interface Properties: - `agenda`: *{scrollable?: boolean, showEmptyDays?: boolean, size?: number, type?: "month" | "day" | "year" | "week"}* - Configures the agenda view. - `calendar`: *{count?: boolean, eventDisplay?: "fill" | "exact", labels?: number | boolean | "all", outerDays?: boolean, popover?: boolean, popoverClass?: string, scroll?: "horizontal" | "vertical", size?: number, type?: "month" | "year" | "week", weekNumbers?: boolean}* - Configures the calendar view. - `schedule`: *{allDay?: boolean, currentTimeIndicator?: boolean, days?: boolean, endDay?: number, endTime?: string, hideEmptyColumns?: boolean, hideInvalidColumns?: boolean, maxEventStack?: number | "auto" | "all", minEventWidth?: number, size?: number, startDay?: number, startTime?: string, timeCellStep?: number, timeLabelStep?: number, timezones?: Array, type?: "month" | "day" | "week", virtualScroll?: boolean}* - `scheduler`: *{allDay?: boolean, currentTimeIndicator?: boolean, days?: boolean, endDay?: number, endTime?: string, hideEmptyColumns?: boolean, hideInvalidColumns?: boolean, maxEventStack?: number | "auto" | "all", minEventWidth?: number, size?: number, startDay?: number, startTime?: string, timeCellStep?: number, timeLabelStep?: number, timezones?: Array, type?: "month" | "day" | "week", virtualScroll?: boolean}* - Configures the scheduler view. - `timeline`: *{columnWidth?: MbscTimelineColumnWidth, currentTimeIndicator?: boolean, endDay?: number, endTime?: string, eventDisplay?: "fill" | "exact", eventHeight?: "variable" | "equal", eventList?: boolean, hideEmptyRows?: boolean, hideInvalidRows?: boolean, maxEventStack?: number | "all", resolutionHorizontal?: "month" | "day" | "year" | "week" | "hour" | "quarter", resolutionVertical?: "day", resourceReorder?: boolean, rowHeight?: "variable" | "equal", size?: number, startDay?: number, startTime?: string, timeCellStep?: number, timeLabelStep?: number, type?: "month" | "day" | "year" | "week", virtualScroll?: boolean, weekNumbers?: boolean, zoomLevels?: { [key:string]: MbscTimelineZoomLevel }}* - Configures the timeline view. ### MbscLocale Interface Properties: - `allDayText`: *string* - `amText`: *string* - `calendarSystem`: *MbscCalendarSystem* - `cancelText`: *string* - `clearText`: *string* - `closeText`: *string* - `dateFormat`: *string* - `dateFormatFull`: *string* - `dateFormatLong`: *string* - `dateText`: *string* - `dateWheelFormat`: *string* - `dayNames`: *Array* - `dayNamesMin`: *Array* - `dayNamesShort`: *Array* - `daySuffix`: *string* - `dayText`: *string* - `eventText`: *string* - `eventsText`: *string* - `filterEmptyText`: *string* - `filterPlaceholderText`: *string* - `firstDay`: *number* - `fromText`: *string* - `hourText`: *string* - `minuteText`: *string* - `monthNames`: *Array* - `monthNamesShort`: *Array* - `monthSuffix`: *string* - `monthText`: *string* - `moreEventsPluralText`: *string* - `moreEventsText`: *string* - `nextMonthText`: *string* - `nextYearText`: *string* - `noEventsText`: *string* - `nowText`: *string* - `pmText`: *string* - `prevMonthText`: *string* - `prevYearText`: *string* - `rangeEndHelp`: *string* - `rangeEndLabel`: *string* - `rangeStartHelp`: *string* - `rangeStartLabel`: *string* - `rtl`: *boolean* - `secondText`: *string* - `selectedPluralText`: *string* - `selectedText`: *string* - `setText`: *string* - `timeFormat`: *string* - `timeText`: *string* - `timeWheels`: *string* - `toText`: *string* - `todayText`: *string* - `weekText`: *string* - `yearSuffix`: *string* - `yearText`: *string* ### MbscRecurrenceRule Interface Properties: - `count`: *number* - `day`: *number | Array* - `from`: *[MbscDateType](#type-MbscDateType)* - `interval`: *number* - `month`: *number | Array* - `pos`: *number* - `repeat`: *"daily" | "weekly" | "monthly" | "yearly"* - `until`: *[MbscDateType](#type-MbscDateType)* - `weekDays`: *string* - `weekStart`: *string* ### MbscResource Interface Properties: - `background`: *string* - Specifies the background color of the resource row or column. - `children`: *Array<[MbscResource](#type-MbscResource)>* - Child resources. - `collapsed`: *boolean* - Specifies the displayed state of the child resource group. - `color`: *string* - Specifies the default event color 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. - `cssClass`: *string* - Specifies a css class for the resource row or column. - `eventCreation`: *boolean* - Disables event creation on specific resources by setting it to false. Defaults to true. - `eventDragBetweenResources`: *boolean* - Specifies whether the events in this resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the [dragBetweenResources](#opt-dragBetweenResources) option. - `eventDragBetweenSlots`: *boolean* - Specifies whether the events in this slot are movable across slots. Has precedence over the [dragBetweenSlots](#opt-dragBetweenSlots) option. - `eventDragInTime`: *boolean* - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventOverlap`: *boolean* - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize`: *boolean* - Specifies whether the events in this resource are resizable. Has precedence over the [dragToResize](#opt-dragToResize) option. - `fixed`: *boolean* - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-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 dra & rop and event creation functionalities to work properly. - `id`: *string | number* - The id of the resource. - `name`: *string* - Specifies the name of the resource. - `reorder`: *boolean* - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. The `MbscResource` supports custom properties in the form: ``` [x:string]: any ``` ### MbscResponsiveOptions Interface The `MbscResponsiveOptions` supports custom properties in the form: ``` [key:string]: MbscEventcalendarOptions & {breakpoint?: number} ``` The keys are the names of the breakpoints, and the values are objects containing the options for the given breakpoint. The `breakpoint` property, when present, specifies the min-width in pixels. The options will take into effect from that width. :::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 ### MbscSlot Interface Properties: - `eventDragBetweenSlots`: *boolean* - Specifies whether the event is movable across slots. - `id`: *string | number* - The id of the slot. It that can be referenced in the events/invalids/colors data. - `name`: *string* - The name of the slot that will be displayed at the top of the slot column. The `MbscSlot` supports custom properties in the form: ``` [x:string]: any ``` ### MbscTimezonePlugin Interface Properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* --- ## Blocked out dates You can show blocked out time ranges with the [`invalid`](./api#opt-invalid) option. By default the events and the blocked out dates will be displayed on the view even if there is collision. The [`invalid`](./api#opt-invalid) option supports the following formats: JavaScript Date objects, ISO8601 strings or moment object. These formats can be passed directly to the array in which case the whole day will be disabled or as an object where the blocked out ranges can be customized with the following properties: `allDay`, `start`, `end`, `title`, `recurring`. Custom properties can also be passed to the invalid object which will also be passed to the life-cycle events and this can help with the identification/validation of the invalids. If an event interacts with an invalid range the event will be reverted to it's original position and the [`@event-update-failed`](./api#event-onEventUpdateFailed) event will be fired. (If the [`dragToMove`](./api#opt-dragToMove) or the [`dragToResize`](./api#opt-dragToResize) options were used.) If a newly created event collides with a blocked out date the event won't be created and the [`@event-create-failed`](./api#event-onEventCreateFailed) event will be fired. (If the [`dragToCreate`](./api#opt-dragToCreate) option was used) ```javascript title="Invalid array example with various properties" import moment from 'moment-timezone'; const invalid = [ /* Passing exact dates will block out the entire day */ new Date(2021, 1, 7), // Date object '2021-10-15T12:00', // string moment("2020-12-25"), // moment object /* Block out date range passed as an object */ { // multi day range with date string start: '2021-10-15T12:00', end: '2021-10-18T13:00', title: 'Company 10th anniversary', type: 'day-off' // custom property }, { // multi day range with date object allDay: true, start: new Date(2021, 2, 7, 10, 10), end: new Date(2021, 2, 9, 20, 20), title: 'Conference for the whole team', type: 'conference' // custom property }, { // multi day time range with recurring and time string start: '13:00', end: '12:00', recurring: { repeat: 'weekly', weekDays: 'MO,TU,WE,TH,FR' }, title: 'Lunch break', type: 'lunch' // custom property } ]; ``` ![Eventcalendar blocked out dates](/img/v6/blocked-out-dates.gif) --- ## Third party calendar integration ## Overview The Calendar Integration is an optional plugin, that includes synchronization with your Google and Outlook calendar services. It can be installed and used with the Mobiscroll Event Calendar as described below. :::info Currently, the calendar integration plugins cannot be used in Chrome extensions, because the CSP rules do not allow loading scripts from 3rd party domains. ::: ## Installing the Calendar Integration Plugin When your Mobiscroll package is created with the [Download Builder](https://download.mobiscroll.com) and you have access to the Calendar Integration, you can choose to include it in the built package. In this case you will need to make sure you checked the Calendar Integration before downloading the package from the download page. After installing your downloaded package, the Calendar Integration will be available for import. When you're using the full Mobiscroll package from NPM, then you have the possibility to install the Calendar Integration as an additional package (also from NPM). In this case, after successfully using the [Mobiscroll CLI](https://docs.mobiscroll.com/cli) to configure the project, you will have to install the `@mobiscroll/calendar-integration` package from npm. Use the following command: ```bash npm install @mobiscroll/calendar-integration ``` ## Google calendar integration The Google Calendar Integration is a part of the third party calendar integrations plugin that manages the synchronization with your Google calendar services. ### Public google calendars The public google calendar integration allows you to load events from a public calendar without user authentication. Calling the `init` function will do the necessary initializations for the third party. After the init, you can list the events from the public calendar. ```html ``` :::info The public google calendar integration only supports reading events. Writing, updating, or deleting events requires the private calendar integration described below. ::: ### Private google calendars The private google calendar integration allows your app to connect with google calendar services for reading and managing events. Once initialized, users can sign in with their google account, view their calendars and events, and create, update, or delete events based on their granted permissions. ### Key details - **User presence required** The user must be in front of the computer and logged in for synchronization to happen. Sync is handled through client-side code. - **User-driven updates** Calendar syncing takes place when the user is logged in and interacting with the application. This approach gives users full control over when and how their data is synchronized. - **Active session required** To update or fetch events, the user needs to be logged in and have the application open. This means that changes made while the user is active — such as adding, editing, or deleting events — will be reflected in their connected calendar. - **Server-side actions** Server-generated events or background updates won't automatically appear in the connected calendar. To sync those changes, the user must be signed in and running the client-side integration. ### Login and sync flow Follow these steps to set up and use the calendar integration correctly: 1. **User initiates sign-in** Start the sign-in process from the browser using the Mobiscroll Calendar Integration SDK. 2. **User authenticates and grants permissions** The user logs in and accepts the requested calendar permissions. 3. **Connection established** Once authenticated, Mobiscroll can read and write events between your app and the connected calendar — as long as the user is active in the browser. 4. **Sync while the user is active** Event synchronization happens only while the user is logged in and the client-side code is running. 5. **Next sync also requires presence** Each new synchronization (for example, when fetching updated events or pushing new ones) requires the user to be logged in and active in the app. Calling the `init` function will do the necessary initializations for the third party. For this step you need to use an API key and a client ID. After the `init`, you can sign in, list your calendars and events and create, update or delete the events on the calendars you have permission to. ```html ``` ### Server side tokens By default the authentication happens entirely on the client side. However, since the introduction of the new [Google Identity Services](https://developers.google.com/identity/gsi/web), the received access token, which ensures access to the user's calendars, is only valid for an hour. After expiry, the user will be prompted again for consent. You can refresh an access token without prompting the user for permission, but this needs to be done server side. To enable this, in the init config object set the auth option to `'server'`, and specify the `authUrl` and `refreshUrl` pointing to your server endpoints. The `authUrl` endpoint will receive a POST request, containing a unique authorization code. To exchange an authorization code for an access token, send a POST request to the https://oauth2.googleapis.com/token endpoint and set the following parameters: * `client_id` - The client ID obtained from the Google API Console Credentials page. * `client_secret` - The client secret obtained from the Google API Console Credentials page. * `code` - The received authorization code. * `grant_type` - This field's value must be set to `authorization_code`. * `redirect_uri` - This field's value must be set to `postmessage`. ``` title="A sample request" POST /token HTTP/1.1 Host: oauth2.googleapis.com Content-Type: application/x-www-form-urlencoded code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7& client_id=your_client_id& client_secret=your_client_secret& redirect_uri=postmessage& grant_type=authorization_code ``` ``` title="A sample response" { "access_token": "1/fFAGRNJru1FTz70BzhT3Zg", "expires_in": 3599, "token_type": "Bearer", "scope": "https://www.googleapis.com/auth/calendar.events.public.readonly https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/calendar.events.owned", "refresh_token": "1//xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI" } ``` Return the received response from the request. The `refreshUrl` endpoint will also receive a POST request, containing the refresh token, received earlier. To refresh an access token, send a POST request to the https://oauth2.googleapis.com/token endpoint and set the following parameters: * `client_id` - The client ID obtained from the Google API Console Credentials page. * `client_secret` - The client secret obtained from the Google API Console Credentials page. * `refresh_token` - The received refresh token. * `grant_type` - This field's value must be set to `refresh_token`. ``` title="A sample request" POST /token HTTP/1.1 Host: oauth2.googleapis.com Content-Type: application/x-www-form-urlencoded client_id=your_client_id& client_secret=your_client_secret& refresh_token=your_refresh_token& grant_type=refresh_token ``` ``` title="A sample response" { "access_token": "1/fFAGRNJru1FTz70BzhT3Zg", "expires_in": 3599, "token_type": "Bearer", "scope": "https://www.googleapis.com/auth/calendar.events.public.readonly https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/calendar.events.owned" } ``` Return the received response from the request. #### Complete example A complete example with Node.js, ASP.NET and PHP **Node.js** ```js // Client import { googleCalendarSync } from '@mobiscroll/calendar-integration'; googleCalendarSync.init({ auth: 'server', authUrl: 'http://example.com/auth', clientId: 'YOUR_CLIENT_ID', refreshUrl: 'http://example.com/refresh', }); // Server const http = require('http'); const https = require('https'); const YOUR_CLIENT_ID = 'YOUR_CLIENT_ID'; const YOUR_CLIENT_SECRET = 'YOUR_CLIENT_SECRET'; function getToken(type, codeOrToken, callback) { const postData = 'client_id=' + YOUR_CLIENT_ID + '&' + 'client_secret=' + YOUR_CLIENT_SECRET + '&' + (type === 'refresh' ? 'grant_type=refresh_token&' + 'refresh_token=' + codeOrToken : 'grant_type=authorization_code&' + 'code=' + codeOrToken + '&' + 'redirect_uri=postmessage&' + 'code_verifier=' ) const postOptions = { host: 'oauth2.googleapis.com', port: '443', path: '/token', method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': Buffer.byteLength(postData) } }; const postReq = https.request(postOptions, function (response) { response.setEncoding('utf8'); response.on('data', d => { callback(d); }); }); postReq.on('error', (error) => { console.log(error) }); // Post the request with data postReq.write(postData); postReq.end(); } function getPostData(req, callback) { let body = ''; req.on('data', (data) => { body += data; }); req.on('end', () => { const parsed = new URLSearchParams(body); const data = {} for (const pair of parsed.entries()) { data[pair[0]] = pair[1]; } callback(data); }); } function checkCSRF(req, res) { // Check if CSRF header is present if (req.headers['x-requested-with'] === 'XmlHttpRequest') { return true; } // Otherwise end the request res.statusCode = 500; res.end(); return false; } function sendResponse(res, data) { // Set the headers in case of CORS request res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With'); // Send data res.end(data); } const server = http.createServer(function (req, res) { if (req.method === 'OPTIONS') { // Handle preflight request (in case of CORS request) res.setHeader('Access-Control-Allow-Origin', '*'); // Use your own domain instead of the '*' res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With'); res.end(); } else if (req.url.startsWith('/auth')) { // Handle auth if (checkCSRF(req, res)) { getPostData(req, (data) => { // Exchange auth code to access token (on sign in) getToken('auth', data.code, (token) => { sendResponse(res, token); }); }); } } else if (req.url.startsWith('/refresh')) { // Handle refresh if (checkCSRF(req, res)) { getPostData(req, (data) => { // Exchange refresh token to access token (on access token expiry) getToken('refresh', data.refresh_token, (token) => { sendResponse(res, token); }); }); } } }); server.listen(8080); ``` **ASP.NET** ```csharp class HttpServer { public static HttpListener listener; public static string url = "http://localhost:8080/"; private static readonly HttpClient client = new HttpClient(); public static Dictionary GetKeyValuePairs(string data) { return data.Split('&') .Select(value => value.Split('=')) .ToDictionary(pair => pair[0], pair => pair[1]); } public static void SendResponse(HttpListenerRequest request, HttpListenerResponse resp, string type) { if (!request.HasEntityBody) { resp.Close(); } Stream body = request.InputStream; StreamReader reader = new StreamReader(body, request.ContentEncoding); string codeOrToken = type == "auth" ? GetKeyValuePairs(reader.ReadToEnd())["code"] : GetKeyValuePairs(reader.ReadToEnd())["refresh_token"]; string postData = "client_id=" + YOUR_CLIENT_ID + "&" + "client_secret=" + YOUR_CLIENT_SECRET + "&" + (type == "refresh" ? "grant_type=refresh_token&" + "refresh_token=" + codeOrToken : "grant_type=authorization_code&" + "code=" + codeOrToken + "&" + "redirect_uri=postmessage&" + "code_verifier="); // Set the headers in case of CORS request resp.AppendHeader("Access-Control-Allow-Origin", "*"); resp.AppendHeader("Access-Control-Allow-Headers", "X-Requested-With"); // Post the request with data FormUrlEncodedContent content = new FormUrlEncodedContent(GetKeyValuePairs(postData)); HttpResponseMessage response = client.PostAsync("https://oauth2.googleapis.com/token", content).Result; if (response.IsSuccessStatusCode) { HttpContent responseContent = response.Content; string responseString = responseContent.ReadAsStringAsync().Result; byte[] buffer = Encoding.UTF8.GetBytes(responseString); // Get a response stream and write the response to it resp.ContentLength64 = buffer.Length; Stream output = resp.OutputStream; output.Write(buffer, 0, buffer.Length); output.Close(); } else { Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase); } resp.Close(); } public static bool CheckCSRF(HttpListenerRequest req, HttpListenerResponse resp) { // Check if CSRF header is present if (req.Headers["x-requested-with"] == "XmlHttpRequest") { return true; } // Otherwise end the request resp.StatusCode = 500; resp.Close(); return false; } public static async Task HandleIncomingConnections() { bool runServer = true; // Handling requests while (runServer) { HttpListenerContext ctx = await listener.GetContextAsync(); HttpListenerRequest req = ctx.Request; HttpListenerResponse resp = ctx.Response; if (req.HttpMethod == "OPTIONS") { // Handle preflight request (in case of CORS request) resp.AppendHeader("Access-Control-Allow-Origin", "*"); // Use your own domain instead of the '*' resp.AppendHeader("Access-Control-Allow-Headers", "X-Requested-With"); resp.Close(); } else if (req.Url.ToString().Contains("/auth")) { // Handle auth if (CheckCSRF(req, resp)) { SendResponse(req, resp, "auth"); } } else if (req.Url.ToString().Contains("/refresh")) { // Handle refresh if (CheckCSRF(req, resp)) { SendResponse(req, resp, "refresh"); } } } } public static void Main() { // Create a Http server and start listening for incoming connections listener = new HttpListener(); listener.Prefixes.Add("http://localhost:8080/"); listener.Start(); // Handle requests Task listenTask = HandleIncomingConnections(); listenTask.GetAwaiter().GetResult(); // Close the listener listener.Close(); } } ``` **PHP** ```php function checkCSRF() { // Check if CSRF header is present if ($_SERVER['HTTP_X_REQUESTED_WITH'] === 'XmlHttpRequest') { return true; } // Otherwise end the request header("HTTP/1.1 500 Internal Server Error"); return false; } function sendResponse($type) { // Set the headers in case of CORS request header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: X-Requested-With'); // The data you want to send via POST $post_data = [ "client_id" => $YOUR_CLIENT_ID, "client_secret" => $YOUR_CLIENT_SECRET, "grant_type" => $type === 'refresh' ? "refresh_token" : "authorization_code", "refresh_token" => $type === 'refresh' ? $_POST['refresh_token'] : "", "code" => $type === 'refresh' ? "" : $_POST['code'], "redirect_uri" => "postmessage", "code_verifier" => "" ]; // url-ify the data for the POST $data_string = http_build_query($post_data); // Open connection $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/x-www-form-urlencoded', 'Content-Length: ' . strlen($data_string), )); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, "https://oauth2.googleapis.com/token"); curl_setopt($ch, CURLOPT_PORT, 443); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); // SSL options are set for testing purposes curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // So that curl_exec returns the contents of the cURL; rather than echoing it curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Execute post $result = curl_exec($ch); if (curl_errno($ch)) { print curl_error($ch); } echo $result; curl_close($ch); } if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { // Handle preflight request (in case of CORS request) header('Access-Control-Allow-Origin: *'); // Use your own domain instead of the '*' header('Access-Control-Allow-Headers: X-Requested-With'); } else if (htmlspecialchars($_GET["action"]) === 'auth') { // Handle auth if (checkCSRF()) { sendResponse('auth'); } } else if (htmlspecialchars($_GET["action"]) === 'refresh') { // Handle refresh if (checkCSRF()) { sendResponse('refresh'); } } ``` ### API Configuration options ### apiKey string The API Key obtained from the Google API Console Credentials page. ### auth "client" | "server" When set to `'server'`, server-side endpoints must be implemented to get the auth access token from Google. ### authUrl string Server side endpoint for receiving an access token from Google on sign in, when the `auth` option is set to `'server'`. ### clientId string The client ID obtained from the Google API Console Credentials page. ### gapi any The gapi object, if already loaded. If not specified, the library will load it. ### gis any The Google Identity Services client library, if already loaded. If not specified, the library will load it. ### refreshUrl string Server side endpoint for receiving a new access token from Google on expiry, when the `auth` option is set to `'server'`. ### scopes string Specify custom scopes for Google authentication. The default scopes are `'https://www.googleapis.com/auth/calendar.events.public.readonly https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/calendar.events.owned'` ### timezone string If specified, the event dates will be returned in this timezone. ### timezonePlugin [MbscTimezonePlugin](#type-MbscTimezonePlugin) The timezone plugin, needed if timezone is specified. The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - Events ### @init () => void Callback executed when the library is initialized and ready to use. ### @signed-in () => void Callback executed when the user signed in. ### @signed-out () => void Callback executed when the user signed out. Methods ### addEvent (calendarId: string, event: [MbscCalendarEvent](#type-MbscCalendarEvent), callback: (addedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void ) => Promise Adds an event to the specified calendar. ```js title="Example usage" googleCalendarSync.addEvent( 'MY_CALENDAR_ID', { start: new Date(2022, 1, 15, 12), end: new Date(2022, 1, 16, 14), title: 'My new event', googleEvent: { description: 'My new event description' } }); ``` Parameters: - calendarId - The ID of the calendar - event - The event to add. You can pass Google specific event properties through the `googleEvent` property. The rest of custom properties will be passed to the `extendedProperties` field. - callback - Callback function which is executed when the request is complete. Receives the added event. ### deleteEvent (calendarId: string, event: [MbscCalendarEvent](#type-MbscCalendarEvent), callback: (deletedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void ) => Promise Removes an event in the specified calendar. Parameters: - calendarId - The ID of the calendar - event - The event to delete - callback - Callback function which is executed then the request is complete. Receives the deleted event. ### getCalendars (callback: (calendars: Array) => void ) => Promise Queries the available calendars of the signed in user. Calls the callback function, if specified. Parameters: - callback - A callback function to call with the calendars as parameters, when the query finished. ### getEvents (calendarIds: string | Array, start: Date, end: Date, callback: (events: Array<[MbscCalendarEvent](#type-MbscCalendarEvent)>) => void ) => Promise Queries the events of the specified calendars between two dates. Parameters: - calendarIds - Array of the calendar IDs. - start - Start date of the specified interval. - end - End date of the specified interval. - callback - Callback function which is executed then the request is complete. Receives the list of events as parameter. ### init (config: MbscGoogleCalendarSyncConfig) => void Makes the necessary initializations for the 3rd party. Triggers the `onInit` event when the initialization is ready, if specified. Parameters: - config - The configuration object for the calendar integration ### isSignedIn () => boolean Checks if the user is signed in or not. ### signIn () => Promise If the user is not signed in, starts the sign in flow. On success, triggers the `onSignedIn` event. ### signOut () => Promise If the user is signed in, signs out. On success triggers the `onSignedOut` event. ### updateEvent (calendarId: string, event: [MbscCalendarEvent](#type-MbscCalendarEvent), callback: (updatedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void ) => Promise Updates an event in the specified calendar. ```js title="Example usage" googleCalendarSync.updateEvent( 'MY_CALENDAR_ID', { start: new Date(2022, 1, 20, 10), end: new Date(2022, 1, 11, 15), title: 'My updated event', id: 1, googleEvent: { description: 'My updated event description' } }); ``` Parameters: - calendarId - The ID of the calendar - event - The event to update. You can pass Google specific event properties through the `googleEvent` property. The rest of custom properties will be passed to the `extendedProperties` field. - callback - Callback function which is executed then the request is complete. Receives the updated event. ## Outlook calendar integration The Outlook Calendar Integration is a part of the third party calendar integrations plugin that manages the synchronization with your Outlook calendar services. ### Outlook calendars Calling the `init` function will do the necessary initializations for the third party. For this step you need to use a [client ID](https://docs.microsoft.com/en-us/graph/auth-v2-user). After the init, you can sign in, list your calendars and events and create, update or delete the events on the calendars you have permission to. ```html ``` ### API Configuration options ### clientId string The client ID obtained from the Outlook web app. ### msal any The Microsoft Authentication Library, if already loaded. If not specified, the library will load it. ### msalClient any The instance of the client application, if already loaded. If not specified, the library will load it. ### pageSize number The maximum number of events to retrieve with one request. Default value is `1000`. ### redirectUri string The location where the authorization server sends the user once the app has been successfully authorized. Default value is `'http://localhost:3000'`. ### timezone string If specified, the event dates will be returned in this timezone. ### timezonePlugin [MbscTimezonePlugin](#type-MbscTimezonePlugin) The timezone plugin, needed if timezone is specified. The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - Events ### @init () => void Callback executed when the library is initialized and ready to use. ### @signed-in () => void Callback executed when the user signed in. ### @signed-out () => void Callback executed when the user signed out. Methods ### addEvent (calendarId: string, event: [MbscCalendarEvent](#type-MbscCalendarEvent), callback: (addedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void ) => Promise Adds an event to the specified calendar. ```js title="Example usage" outlookCalendarSync.addEvent( 'MY_CALENDAR_ID', { start: new Date(2022, 1, 15, 12), end: new Date(2022, 1, 16, 14), title: 'My new event', outlookEvent: { isReminderOn: true, } }); ``` Parameters: - calendarId - The ID of the calendar - event - The event to add. You can pass Outlook specific event properties through the `outlookEvent` property. - callback - Callback function which is executed when the request is complete. Receives the added event. ### deleteEvent (calendarId: string, event: [MbscCalendarEvent](#type-MbscCalendarEvent), callback: (deletedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void ) => Promise Removes an event in the specified calendar. Parameters: - calendarId - The ID of the calendar - event - The event to delete - callback - Callback function which is executed then the request is complete. Receives the deleted event. ### getCalendars (callback: (calendars: Array) => void ) => Promise Queries the available calendars of the signed in user. Calls the callback function, if specified. Parameters: - callback - A callback function to call with the calendars as parameters, when the query finished. ### getEvents (calendarIds: string | Array, start: Date, end: Date, callback: (events: Array<[MbscCalendarEvent](#type-MbscCalendarEvent)>) => void ) => Promise Queries the events of the specified calendars between two dates. Parameters: - calendarIds - Array of the calendar IDs. - start - Start date of the specified interval. - end - End date of the specified interval. - callback - Callback function which is executed then the request is complete. Receives the list of events as parameter. ### init (config: MbscOutlookCalendarSyncConfig) => void Makes the necessary initializations for the 3rd party. Triggers the `onInit` event when the initialization is ready, if specified. Parameters: - config - The configuration object for the calendar integration ### isSignedIn () => boolean Checks if the user is signed in or not. ### signIn () => Promise If the user is not signed in, starts the sign in flow. On success, triggers the `onSignedIn` event. ### signOut () => Promise If the user is signed in, signs out. On success triggers the `onSignedOut` event. ### updateEvent (calendarId: string, event: [MbscCalendarEvent](#type-MbscCalendarEvent), callback: (updatedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)) => void ) => Promise Updates an event in the specified calendar. ```js title="Example usage" outlookCalendarSync.updateEvent( 'MY_CALENDAR_ID', { start: new Date(2022, 1, 20, 10), end: new Date(2022, 1, 11, 15), title: 'My updated event', id: 1, outlookEvent: { isReminderOn: false, } }); ``` Parameters: - calendarId - The ID of the calendar - event - The event to update. You can pass Outlook specific event properties through the `outlookEvent` property. - callback - Callback function which is executed when the request is complete. Receives the updated event. --- ## Working with recurring events ## Querying recurring events The Calendar Integration when queries recurring events from the Google or the Outlook calendar, it will receive individual event occurences for the given period of time. So every event arrives as an individual event. The Mobiscroll Eventcalendar won't know about the recurrence in these cases. To tell whether these events are part of a recurring set or not, you need to check the properties of the event. 1. The google event has the `event.googleEvent.recurringEventId` field set in case of recurring events - which is the ID of the original recurring event. 2. The outlook event has the `event.outlookEvent.type` field set to `occurrence` in case of a recurring events, otherwise the type is `singleInstance` ## Creating recurring events When you want to create a recurring event through the Mobiscroll Eventcalendar, you can do so by setting the `recurrence` field to the RRULE before sending it to the Google or Outlook calendar. For example: ```js title="Create a recurring event in a Google calendar" const onEventCreate = (args, inst) => { const event = args.event; event.googleEvent = { recurrence: ['RRULE:FREQ=WEEKLY;BYDAY=TH;COUNT=4'], // ...other google specific properties } // then send it to Google googleCalendarSync.addEvent('MY_CALENDAR_ID', event); } ``` When this is done, the [getEvents](./calendar-integrations.md#method-google-getEvents) function will return the individual occurences of the recurring set, the same way it is described [above](#querying-recurring-events). ## Updating a single recurring instance To update a single occurence of a recurring event, you can drag it on the Eventcalendar UI (when the [dragToMove](../api#opt-dragToMove) option is enabled). Since the events you get from the calendar integrations are individual occurences, updating one will not update the whole set of recurring events. So updating a single instance of the recurring set is the default behavior. ## Deleting a recurring instance As mentioned above in the [query section](#querying-recurring-events), by default you get the recurring event occurences as single individual events, when querying events from Google or Outlook calendars. Deleting a single event instance will only remove that single instance from the set. ## Updating a recurring event To update the whole recurring set or parts of it (for example: this and following events), you will need to use direct API calls to the Google or Outlook calendars themselves, since this is not supported by the Calendar Integrations currently. Here's a link for a more detailed description on [how to update recurring events with the Google Calendars](https://developers.google.com/calendar/api/guides/recurringevents). For Outlook recurring events check out the [Outlook schedule recurring events guide](https://learn.microsoft.com/en-us/graph/outlook-schedule-recurring-events). --- ## Calendar # Calendar Use the [Event Calendar](https://demo.mobiscroll.com/eventcalendar) as a traditional [month view](https://demo.mobiscroll.com/eventcalendar/desktop-month-view#) or combine it with an agenda as a [week view](https://demo.mobiscroll.com/agenda/daily-agenda-with-week-calendar#). The events can be rendered as [labels](https://demo.mobiscroll.com/eventcalendar/event-labels#) or in a [popover](https://demo.mobiscroll.com/eventcalendar/event-popover#) that is shown on day click. ## Overview The Calendar view supports everything from [single to multiple week views](https://demo.mobiscroll.com/eventcalendar/month-week-view#) all the way to [month grids](https://demo.mobiscroll.com/eventcalendar/quarter-year-view#) with various ways to render events. The capabilities like [recurring events](/javascript/core-concepts/recurrence), [all-day, multi-day events](#opt-data), [responsiveness](#responsiveness) are supported by the Event Calendar. ![Event Calendar overview](/img/v6/event-calendar-overview.png) ## Showing the Calendar ### View combination The four views - [scheduler](./scheduler), [calendar](./calendar), [timeline](./timeline), [agenda](./agenda) - can be used alone or combined with each-other to create the perfect user experience on mobile, desktop and on everything in-between. For example, you can choose to [render an agenda below the calendar](https://demo.mobiscroll.com/agenda/daily-agenda-with-week-calendar#) broken up into days ordered chronologically. The view option will look like the following: ```html title='Weekly Calendar combined with Daily Agenda' ``` ### Configuring the view The Calendar view can be configured through the `view` option. Below are listed the `calendar` object properties which can help you fine-tune this view. ```html title='Example' ``` ### count boolean If `true`, it will display the number of events on the days with events. **Default value**: `false` ### eventDisplay "fill" | "exact" Specifies how events are displayed. - If set to `'exact'`, events are displayed according to their start and end times. - If set to `'fill'`, events cover the entire day. **Default value**: `'fill'` ### labels number | boolean | "all" 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](#opt-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 become 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. **Default value**: `true` ### outerDays boolean Show or hide days from previous and next months. Hiding only works for type: 'month'. **Default value**: `false` ### popover boolean 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. **Default value**: `undefined` ### popoverClass string A CSS class that's added to the popover element. Can be used to customize the styling of the popover on a calendar basis. ### scroll "horizontal" | "vertical" Specifies the direction of the calendar scroll. Can be 'horizontal' or 'vertical' **Default value**: `'horizontal'` ### size number Specifies the number of displayed weeks/months. **Default value**: `1` ### type "month" | "year" | "week" Specifies the calendar type **Default value**: `'month'` ### weekNumbers boolean Show or hide week numbers. **Default value**: `false` ## Responsiveness The Event Calendar is [fully responsive](https://demo.mobiscroll.com/eventcalendar/responsive-month-view). It adapts to the available space and fills the screen to look good everywhere. While you don't have to worry about the width the height can be manually adjusted with the [height](#opt-height) option. This 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. Use the [responsive](#opt-responsive) option to configure how the calendar behaves on different sized screens. The responsive option is equipped with five breakpoints: - `xsmall` (up to 575px), - `small` (up to 767px), - `medium` (up to 991px), - `large` (up to 1199px), - `xlarge` (from 1200px). Also, custom breakpoints can be added if necessary: - `my-custom-breakpoint: { breakpoint: 600 }` (from 600px up to the next breakpoint). :::info The available width is queried from the container element of the component and not the browsers viewport like in css media queries. ::: ```html title='Responsive configuration with the view option' ``` ![Event Calendar responsive behavior](/img/v6/event-calendar-responsive.gif) ## Templating The display of Calendar can be customized with different [solt functions](#slots). ### The event label and their content There are two approaches you can take: - Customize the label contents, that appears on the calendar - for this you will want to use the [calendarEventContent](#slot-calendarEventContent) option. The Event Calendar will take care of styling and you can focus on what you show inside of the label. - Customize the labels that appear on the calendar view - use the [calendarEvent](#slot-calendarEvent) option. The Event Calendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you. Check out how you can style labels and their content in [this example](https://demo.mobiscroll.com/vue/eventcalendar/customize-label-look-and-feel#) or just play with the slider below to see the differences. ### The event in popover and their content The events can be customized in two ways: - Customize the event content that appears on the popover - by using the [popoverEventContent](#slot-popoverEventContent) option. The Event Calendar will take care of styling and you can focus on what you show inside of the event. - Customize the events that appear on the popover - with the [popoverEvent](#slot-popoverEvent) option. It should return the markup of the event. The Event Calendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you. Check out how you can style events and their content in [this example](https://demo.mobiscroll.com/vue/eventcalendar/customize-event-popover#) or just play with the slider below to see the differences. ### The event calendar header Customize how the header of the Event Calendar looks and how the components are arranged with the [header](#slot-header) option. It takes a function that should return the desired markup. In the returned markup, you can use custom html as well as the built in header components of the calendar. While fully customizing the header is very usefull, sometimes it's desireable to customize only parts of it. In this case you can take advantage of the default header's [building blocks](/vue/eventcalendar/templating#header-templating). These components let you put toghether the header you want, while you don't have to worry about the functionality behind them. Check out how you can style the header in [this example](https://demo.mobiscroll.com/vue/eventcalendar/customizing-header#) or just play with the slider below to see the differences. ## Event order The rendered event order is determined by the following two concepts: 1. Event data order 2. Event layout The combination of these concepts results in the final rendered event order. ### Event data order The sequence in which events are processed before being passed to the layout algorithm. The default ordering rules are as follows: 1. All-day events are placed at the top. 2. Non-all-day events follow, sorted by their start times. 3. Events with the same start time are further ordered alphabetically by their titles. This default order can be modified using the `order` property in the event [event data](#opt-data). The order property takes precedence over the default rules. If two events have the same order value, the default rules apply. For more complex ordering requirements, the [eventOrder](#opt-eventOrder) option can be used. This option accepts a function that compares two events and returns an order (-1 or 1). ### Event layout The event layout process determines the visual positioning and dimensions of events. This is a built-in functionality and cannot be altered externally. The layout algorithm processes the sorted event list and calculates each event's position and size. The algorithm follows these steps: 1. The first event is placed in the first position of the event track. 2. If two or more events overlap in their start/end times, the later event is placed in the next event track, positioned below to the previous event. 3. If a subsequent event does not overlap with any already added events, it is placed back in the first event track. 4. This process continues until all events are positioned within their respective rows. ## API Here is a comprehensive list of all the specific options, events and methods of the Event Calendar view. ### Options Explore the following API options that help you easily configure the Event Calendar. ### 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](#opt-dragToCreate) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-eventDelete) option. **Default value**: `undefined` ### colors Array<[MbscCalendarColor](#type-MbscCalendarColor)> Specifies the color for certain dates or date ranges on the calendar. The [`MbscCalendarColor`](#type-MbscCalendarColor) type 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. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. :::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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The colors can be combined with the [labels](#opt-labels) or [marked](#opt-marked) options. ::: ```js [ { 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` ### context string | HTMLElement The DOM element in which the popups (event popover, year and month picker) are rendered. Can be a selector string or a DOM element. **Default value**: `'body'` ### cssClass string Specifies a custom CSS class for the component. **Default value**: `undefined` ### data Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> The events for the Eventcalendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::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-onEventClick) event will receive the event object as argument, containing the custom properties as well. ::: :::info Use the [getEvents](#method-getEvents) method to get the events between two dates. ::: ```js 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](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. If not specified, it defaults to the [displayTimezone](#opt-displayTimezone). **Default value**: `undefined` ### defaultSelectedDate [MbscDateType](#type-MbscDateType) Specifies the initial selected date on the calendar. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. **Default value**: `undefined` ### displayTimezone string The timezone in which the data is displayed. :::info When using timezones, the [exclusiveEndDates](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. **Default value**: `'local'` ### 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](#opt-dragBetweenResources) option. Consider that [dragToMove](#opt-dragToMove) has to be enabled. **Default value**: `true` ### 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](#opt-newEventText) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-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](#opt-clickToCreate) and [dragToCreate](#opt-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](#type-MbscCalendarEvent), event2: [MbscCalendarEvent](#type-MbscCalendarEvent)) => number Determines the ordering of the events within the same day. Can be a function that accepts two event objects as arguments and should return -1 or 1. If not specified, the default order is: - all day events - rest of events, sorted by start time; events with identical start times, will be ordered alphabetically based on their title **Default value**: `undefined` ### 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) => void | [MbscCalendarEvent](#type-MbscCalendarEvent) Use this option to set properties to the new event created with click or drag. The event creation is handled by the [clickToCreate](#opt-clickToCreate) and [dragToCreate](#opt-dragToCreate) options. It takes a function that should return the properties for the new event. The argument object passed to this function has the following properties: - `start`: *Date* - The date when the newly created event will start. - `resource`: *string | number* - The id of the resource where the event creation started. ```js extendDefaultEvent: (args) => { return { color: args.resource === 'admin' ? 'green' : 'red', title: 'My event', }; } ``` **Default value**: `undefined` ### 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` ### 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](#type-MbscDateType)> | Array<[MbscCalendarInvalid](#type-MbscCalendarInvalid)> 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* - 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* - Specifies the [resource](#opt-resources) 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](#opt-slots) 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. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: ```js [ // 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` The [`MbscCalendarInvalid`](#type-MbscCalendarInvalid) type has the following properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### invalidateEvent "start-end" | "strict" Specifies how to validate events against [invalid](#opt-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](#type-MbscCalendarLabel)> Specifies labels for calendar days. The [`MbscCalendarLabel`](#type-MbscCalendarLabel) type has the following properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the label. - `cssClass`: *string* - Specifies a custom CSS class that is applied to the label. - `date`: *string | object | Date* - Specifies a single date for the label - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the label - `order`: *number* - Specifies the order of the label in the array. Has precedence over the default ordering rules. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the label - `textColor`: *string* - A color applied on the text. - `title`: *string* - The title of the label. - `tooltip`: *string* - Tooltip for the label :::info The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The labels can be combined with the [colors](#opt-colors) option. ::: ```js [ { 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](#type-MbscCalendarMarked)> Mark certain dates on the calendar. An array containing dates, or objects with the following properties: The [`MbscCalendarMarked`](#type-MbscCalendarMarked) type has the following properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Color of the mark. - `date`: *string | object | Date* - Specifies a single date when this is applicable - `end`: *string | object | Date* - Specifies the end date/time of a date/time range when this is applicable - `markCssClass`: *string* - CSS class for the mark. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range when this is applicable - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. :::info The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The marked days can be combined with the [colors](#opt-colors) option. ::: ```js [ 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](#type-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](#opt-invalid) option with daily recurrence starting from the specific date. **Default value**: `undefined` ### min [MbscDateType](#type-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](#opt-invalid) option with daily recurrence until the specific date. **Default value**: `undefined` ### modules Array Additional modules can be added to the eventcalendar. The option receives an array of module objects. For example, the print module can be added through this option. ```js // import the print module import { print } from '@mobiscroll/print'; // later on, add it to the modules array: modules: [print] ``` ### refDate [MbscDateType](#type-MbscDateType) Specifies the reference date for the view calculation, when multiple days, weeks, months or years are displayed. If not specified, will be today's date. It denotes the reference point when calculating the pages going in the future and in the past. For example if the view type is day, the view size is 3, and the current date is `01/16/2024`, the pages are calculated from this date, so the initial page will contain `[01/16/2024, 01/16/2024, 01/17/2024]`, the next page `[01/18/2024, 01/19/2024, 01/20/2024]` and so on. In case of day view, the reference point will be exactly the specified date. For week, month and year views the reference point will be the start of the week, month or year of the specified day. Changing the reference date will not navigate the calendar to the specified date, it only recalculates the pages from the new reference date. To navigate the view to a specified date and time, use the [selectedDate](#opt-selectedDate) option. **Default value**: `undefined` ### responsive [MbscResponsiveOptions](#type-MbscResponsiveOptions) 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, you can use multiple, but each must have a unique name 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](#type-MbscDateType) Specifies the selected date on the calendar. This can be changed programmatically and when changed the calendar will automatically navigate to the specified date. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. This does not change the reference date that defines the reference point of the navigation pages. To change the reference point for the navigation (e.g. start the paging from the newly selected date) use the [refDate](#opt-refDate) option. You also need to pass a handler for the [onSelectedDateChange](#event-onSelectedDateChange) event to update the selected date when the date is changed from the calendar. **Default value**: `undefined` ### selectedEvents Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Specifies the selected events on the calendar. The [onSelectedEventsChange](#event-onSelectedEventsChange) event will be fired when the selected events change from the calendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. **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` ### showEventBuffer boolean If `true`, it will display the event buffers defined in the [event data](#opt-data). **Default value**: `true` ### showEventTooltip boolean If `false`, it will hide the native tooltip that shows up when hovering over an event. **Default value**: `true` ### 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](../theming/sass-variables) or [create custom themes](../theming/sass-themes). :::info Make sure that the theme you set is included in the downloaded package. ::: **Default value**: `undefined` ### themeVariant "light" | "dark" | "auto" Controls which variant of the [theme](#opt-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 [MbscTimezonePlugin](#type-MbscTimezonePlugin) 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](https://momentjs.com/timezone/) and [luxon](https://moment.github.io/luxon/#/). You can specify either the [dataTimezone](#opt-dataTimezone) or the [displayTimezone](#opt-displayTimezone) or both. Depending on which external library you use you can pass either the `momentTimezone`, `dayjsTimezone` or `luxonTimezone` objects. These objects can be imported from the mobiscroll bundle. **Default value**: `undefined` The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - ### width string | number Sets the width of the component. **Default value**: `undefined` ### Events The Event Calendar ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code. ### @cell-click (args: MbscCellClickEvent, inst: EventcalendarBase) => void Triggered when a cell is clicked on the calendar view, scheduler grid, or timeline grid. 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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 view, scheduler grid, 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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 on a calendar day, scheduler cell, or timeline cell. Parameters: - args - The event argument with the following properties: - `colors`: *Array* - The colors for the hovered cell. - `date`: *Date* - The date of the hovered day. - `events`: *Array* - The events for the hovered cell. - `invalids`: *Array* - The invalid dates for the hovered cell. - `labels`: *Array* - If the cell has labels, contains the label objects for the hovered cell. - `marked`: *Array* - If the cell is marked, contains the marked objects for the hovered cell. - `selected`: *boolean* - Specifies if the cell is currently selected or not (in case of calendar view). - `target`: *HTMLElement* - The DOM element of the cell. - `resource`: *MbscResource* - The resource object for the hovered cell. - inst - The component instance. ### @cell-hover-out (args: MbscCellHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer leaves a calendar day, scheduler cell, or timeline cell. Parameters: - args - The event argument with the following properties: - `colors`: *Array* - The colors for the hovered cell. - `date`: *Date* - The date of the hovered cell. - `events`: *Array* - The events for the hovered cell. - `invalids`: *Array* - The invalid dates for the hovered cell. - `labels`: *Array* - If the cell has labels, contains the label objects for the hovered cell. - `marked`: *Array* - If the cell is marked, contains the marked objects for the hovered cell. - `selected`: *boolean* - Specifies if the cell is currently selected or not (in case of calendar view). - `target`: *HTMLElement* - The DOM element of the cell. - `resource`: *MbscResource* - The resource object for the hovered cell. - inst - The component instance. ### @cell-right-click (args: MbscCellClickEvent, inst: EventcalendarBase) => void Triggered when a cell is right-clicked on the calendar view, scheduler grid, 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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. - `resourceObj`: *MbscResource* - The resource where the event is being created, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is being created, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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' | 'scheduler'* - 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' | 'scheduler'* - The view where the event was created. - `target`: *HTMLElement* - The DOM element of the created event. - `resourceObj`: *MbscResource* - The resource where the event is being created, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is being created, if [slots](#opt-slots) are set. - 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* - The events being deleted in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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* - The deleted events in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicker, if [slots](#opt-slots) are set. - `slotObj`: *MbscResource* - The resource where the event was clicker, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was dragged, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was dragged, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was dragged, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'scheduler' | '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/scheduler 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' | 'scheduler' | '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/scheduler 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' | 'scheduler' | '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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is dragged, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is dragged, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is dragged, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'scheduler' | '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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event is hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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* - The updated events. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) 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* - The original events before the update. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) 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. - `oldResource`: number | string - The id of the resource from which the event was dragged. - `oldResourceObj`: *MbscResource* - The resource from which the event was dragged. - `oldSlot`: number | string - The id of the slot from which the event was dragged. - `oldSlotObj`: *MbscSlot* - The slot from which the event was dragged. - `resource`: number | string - The id of the resource where the event was dropped. - `resourceObj`: *MbscResource* - The resource where the event was dropped. - `slot`: number | string - The id of the slot where the event was dropped. - `slotObj`: *MbscSlot* - The slot where the event was dropped. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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' | 'scheduler'* - 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* - The updated events. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) is enabled. - `oldEvent`: *MbscCalendarEvent* - The original event before the update. - `oldEvents`: *Array* - The original events before the update. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) is enabled. - `resourceObj`: *MbscResource* - The resource where the event is updated, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is updated, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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* - 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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `month`: *Date* - The first day of the visible month in case of month view. - inst - The component instance. ### @selected-date-change (args: MbscSelectedDateChangeEvent, inst: EventcalendarBase) => void Triggered when the selected date is changed, e.g. by clicking on a day on a calendar view, or by using the navigation arrows. You can use this event in conjunction with the [selectedDate](#opt-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](#opt-selectMultipleEvents) is enabled. You can also select events programmatically using the [selectedEvents](#opt-selectedEvents) option. Parameters: - args - The event argument with the following properties: - `events`: *Array* - The selected events. - inst - The component instance. ### Localization The Event Calendar is fully localized. This covers date and time format, button copy, rtl and more. ### 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](#localization-dateFormat) option. **Default value**: `'DDDD, MMMM D, YYYY'` ### dayNames Array The list of long day names, starting from Sunday. **Default value**: `['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']` ### dayNamesMin Array The list of minimal day names, starting from Sunday. **Default value**: `['S', 'M', 'T', 'W', 'T', 'F', 'S']` ### dayNamesShort Array 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 [MbscLocale](#type-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](https://mobiscroll.com/docs/core-concepts/localization#language-modules). 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 The list of full month names. **Default value**: `['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']` ### monthNamesShort Array 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](#localization-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](#localization-moreEventsPluralText) as well, if the plural form is different. **Default value**: `'{count} more'` ### newEventText string Title for the newly created event with the [dragToCreate](#opt-dragToCreate) and the [clickToCreate](#opt-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'` ### 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'` ### 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'` ### Slots The display of the Event Calendar can be customized with different slot functions. ### calendarDay ```html ``` Customize the day cells of the calendar view. If you are looking to customize only the day cells content and don't want to bother with the styling of the cells, use the [calendarDayContent](#slot-calendarDayContent) option. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `selected`: _boolean_ - True if the date is selected. - `events`: _Array_ - The list of events for the day. ### calendarDayContent ```html ``` Customize the day cells content of the calendar view. 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 [calendarDay](#slot-calendarDay) option. The following properties are available: - `date`: _Date_ - The date of the rendered day. - `selected`: _boolean_ - True if the date is selected. - `events`: _Array_ - The list of events for the day. ### calendarEvent ```html ``` Customize the events 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 event, you can use the [calendarEventContent](#slot-calendarEventContent) 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. ### calendarEventContent ```html ``` Customize the event contents, that appears on the calendar. 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 label (ex. add custom hover effects) you will need to use the [calendarEvent](#slot-calendarEvent) 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. ### header ```html ``` Customize the header of the event calendar. You can use custom markup and the built in header components of the calendar. ### popoverEvent ```html ``` Customize the events that appear on 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 [popoverEventContent](#slot-popoverEventContent) 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. ### popoverEventContent ```html ``` Customize the event content that appears on 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 [popoverEvent](#slot-popoverEvent) 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. ### Types ### MbscCalendarColor Interface Properties: - `allDay`: *boolean* - Specifies whether the date you want to color is all day or not. - `background`: *string* - Background color of the cell. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. ### MbscCalendarEvent Interface Properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. ### MbscCalendarInvalid Interface Properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### MbscCalendarLabel Interface Properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the label. - `cssClass`: *string* - Specifies a custom CSS class that is applied to the label. - `date`: *string | object | Date* - Specifies a single date for the label - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the label - `order`: *number* - Specifies the order of the label in the array. Has precedence over the default ordering rules. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the label - `textColor`: *string* - A color applied on the text. - `title`: *string* - The title of the label. - `tooltip`: *string* - Tooltip for the label ### MbscCalendarMarked Interface Properties: - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Color of the mark. - `date`: *string | object | Date* - Specifies a single date when this is applicable - `end`: *string | object | Date* - Specifies the end date/time of a date/time range when this is applicable - `markCssClass`: *string* - CSS class for the mark. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range when this is applicable - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. ### MbscDateType string | Date | object ### MbscLocale Interface Properties: - `allDayText`: *string* - `amText`: *string* - `calendarSystem`: *MbscCalendarSystem* - `cancelText`: *string* - `clearText`: *string* - `closeText`: *string* - `dateFormat`: *string* - `dateFormatFull`: *string* - `dateFormatLong`: *string* - `dateText`: *string* - `dateWheelFormat`: *string* - `dayNames`: *Array* - `dayNamesMin`: *Array* - `dayNamesShort`: *Array* - `daySuffix`: *string* - `dayText`: *string* - `eventText`: *string* - `eventsText`: *string* - `filterEmptyText`: *string* - `filterPlaceholderText`: *string* - `firstDay`: *number* - `fromText`: *string* - `hourText`: *string* - `minuteText`: *string* - `monthNames`: *Array* - `monthNamesShort`: *Array* - `monthSuffix`: *string* - `monthText`: *string* - `moreEventsPluralText`: *string* - `moreEventsText`: *string* - `nextMonthText`: *string* - `nextYearText`: *string* - `noEventsText`: *string* - `nowText`: *string* - `pmText`: *string* - `prevMonthText`: *string* - `prevYearText`: *string* - `rangeEndHelp`: *string* - `rangeEndLabel`: *string* - `rangeStartHelp`: *string* - `rangeStartLabel`: *string* - `rtl`: *boolean* - `secondText`: *string* - `selectedPluralText`: *string* - `selectedText`: *string* - `setText`: *string* - `timeFormat`: *string* - `timeText`: *string* - `timeWheels`: *string* - `toText`: *string* - `todayText`: *string* - `weekText`: *string* - `yearSuffix`: *string* - `yearText`: *string* ### MbscRecurrenceRule Interface Properties: - `count`: *number* - `day`: *number | Array* - `from`: *[MbscDateType](#type-MbscDateType)* - `interval`: *number* - `month`: *number | Array* - `pos`: *number* - `repeat`: *"daily" | "weekly" | "monthly" | "yearly"* - `until`: *[MbscDateType](#type-MbscDateType)* - `weekDays`: *string* - `weekStart`: *string* ### MbscResponsiveOptions Interface The `MbscResponsiveOptions` supports custom properties in the form: ``` [key:string]: MbscEventcalendarOptions & {breakpoint?: number} ``` The keys are the names of the breakpoints, and the values are objects containing the options for the given breakpoint. The `breakpoint` property, when present, specifies the min-width in pixels. The options will take into effect from that width. :::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 ### MbscTimezonePlugin Interface Properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* --- ## CRUD ## Updating event properties The Eventcalendar is bound to an array of event objects as described in the [data binding](data-binding) section. To update a single event with new event data, it's not enough to update the particular event object. A new event array reference is also needed otherwise the change won't be picked up by the eventcalendar. ```html title="Updating an event title" ``` The same concept can be used to add or delete a calendar event. Or to update any properties of an event with incoming data. Regardless where the data comes from (outside of the eventcalendar), be it an edit form or an external API. ## Working with servers The Eventcalendar exposes a variety of [events](api#events) that are triggered on certain actions made on calendar events. These events can be used to send your data to your API or save it to a persistent storage. ### Event create To enable the creation of events on the Eventcalendar you can use the [`dragToCreate`](api#opt-dragToCreate) and the [`clickToCreate`](api#opt-clickToCreate) options (desktop browsers only). When an event is about to be created using click or drag on the Eventcalendar UI, the [`@event-create`](api#event-onEventCreate) event is fired. If not canceled by returning `false` a temporary event is created on the Eventcalendar followed by the [`@event-created`](api#event-onEventCreated). Any of these two events are passed the event properties that can be used to save the event to a persistent storage or to send it through an API. ```html title="Save a new event through an API" ``` ### Event update Similar to [event creation](#event-create) above, to enable event editing you can use the [`dragToResize`](api#opt-dragToResize) and [`dragToMove`](api#opt-dragToMove) options. When an event is about to be updated by dragging on the Eventcalendar UI, the [`@event-update`](api#event-onEventUpdate) event is fired. If not canceled by returning `false` the calendar event is updated on the calendar. This update is followed by the [`@event-updated`](api#event-onEventUpdated). Any of these two events are passed the calendar event previous and new properties that can be used to save the event to a persistent storage or to send it through an API. ```html title="Send an updated event through an API" ``` :::info When updating a recurring event from the UI (by dragging for example), the update won't affect all the occurences of the event. A single instance is updated from a set of occurences by adding an [exception to the rule](../core-concepts/recurrence#rule-exceptions) and creating another event with the changed properties. Adding this exception to the rule is an update to the event, so the [`@event-update`](./api#event-onEventUpdate) and [`@event-updated`](./api#event-onEventUpdated) will be fired as expected. There will also be an [`@event-create`](./api#event-onEventCreate) and [`@event-created](./api#event-onEventCreated) event fired for the changed occurence, that is not be part of the recurring set anymore. ::: In case you would like to edit a recurring event, you can use the `updateRecurringEvent` helper function: ### updateRecurringEvent (originalRecurringEvent: [MbscCalendarEvent](#type-MbscCalendarEvent), oldEventOccurrence: null | [MbscCalendarEvent](#type-MbscCalendarEvent), newEvent: null | [MbscCalendarEvent](#type-MbscCalendarEvent), updatedEvent: null | [MbscCalendarEvent](#type-MbscCalendarEvent), updateMode: "current" | "following" | "all", timezone: string, timezonePlugin: [MbscTimezonePlugin](#type-MbscTimezonePlugin)) => {newEvent: [MbscCalendarEvent](#type-MbscCalendarEvent) | null, updatedEvent: [MbscCalendarEvent](#type-MbscCalendarEvent)} Updates a recurring event, returns the updated and the new event. Parameters: - originalRecurringEvent - The original event to update. - oldEventOccurrence - The original event occurrence in case of & (what is dragged). - newEvent - The created even in case of & (where is dragged). - updatedEvent - The updated event from popup. - updateMode - The update type. ### Event delete When an event is selected on the Eventcalendar, hitting the `Delete` or `Backspace` button will delete the event. Just before the event is deleted, the [`@event-delete`](./api#event-onEventDelete) event is fired. Returning `false` from the `@event-delete` will prevent the delete from happening. If not prevented, there will be an [`@event-deleted`](./api#event-onEventDeleted) event fired and the event will be removed from the Eventcalendar. Either one of these events can be used to send the deletion through an API. ```html title="Notify a server of an event deletion" ``` :::caution When deleting a recurring event, there will not be an [`@event-delete`](./api#event-onEventDelete) nor an [`@event-deleted`](./api#event-onEventDeleted) event fired because the event is not deleted actually. A single instance is deleted from a set of occurences by adding an [exception to the rule](../core-concepts/recurrence#rule-exceptions). Adding this exception to the rule is an update to the event, so the [`@event-update`](./api#event-onEventUpdate) and [`@event-updated`](./api#event-onEventUpdated) are fired instead of the delete. ::: --- ## CSS variables This page lists the Eventcalendar-specific CSS variables that can be overridden to customize colors and visual states. For general theming concepts and shared theme variables, see the [CSS variables overview](../theming/css-variables). :::info Variable names and available options may differ between themes, so make sure to override the variables that correspond to the active theme. ::: --- ## Eventcalendar variables Variables can be overridden globally on `:root` or scoped to a specific container. ```scss :root { --mbsc-eventcalendar-accent: #007aff; --mbsc-eventcalendar-event-color: #34c759; } .my-calendar { --mbsc-eventcalendar-accent: #6200ee; } ``` :::info **Theming & dark mode** Variables can be overridden globally on `:root`, which affects all active themes. To target a specific theme, use its theme selector: - `.mbsc-windows` - `.mbsc-windows-dark` - `.mbsc-ios` - `.mbsc-ios-dark` - `.mbsc-material` - `.mbsc-material-dark` ::: ### iOS theme These variables apply when the `ios` theme is active. - `--mbsc-eventcalendar-accent`: Selected day, active state, primary highlight color - `--mbsc-eventcalendar-on-accent`: Text/icons shown on accent background - `--mbsc-eventcalendar-bg-color`: Main calendar background - `--mbsc-eventcalendar-text-color`: Default text color (days, labels) - `--mbsc-eventcalendar-border-color`: Grid lines, separators - `--mbsc-eventcalendar-event-color`: Event background color - `--mbsc-eventcalendar-event-text`: Text color inside events - `--mbsc-eventcalendar-event-mark`: Small event dot / indicator color - `--mbsc-eventcalendar-input-bg-color`: Input background color inside the Eventcalendar (e.g. filters, header inputs) - `--mbsc-eventcalendar-highlight`: Today / highlighted day background - `--mbsc-eventcalendar-time-color`: Time labels, week numbers - `--mbsc-eventcalendar-disabled-bg-color`: Disabled day background - `--mbsc-eventcalendar-parent`: Timeline parent row background - `--mbsc-eventcalendar-parent-hover`: Timeline parent row hover - `--mbsc-eventcalendar-focus`: Focus outline color (keyboard nav) - `--mbsc-eventcalendar-success`: Success state color - `--mbsc-eventcalendar-error`: Error state color - `--mbsc-eventcalendar-popup-bg-color`: Event popup background - `--mbsc-eventcalendar-popup-list-bg-color`: Popup event list background ### Windows theme These variables apply when the `windows` theme is active. - `--mbsc-eventcalendar-accent`: Selected day / primary accent - `--mbsc-eventcalendar-bg-color`: Calendar background - `--mbsc-eventcalendar-text-color`: Default text color - `--mbsc-eventcalendar-border-color`: Grid / separator color - `--mbsc-eventcalendar-event-color`: Event background - `--mbsc-eventcalendar-on-accent`: Text color on event background - `--mbsc-eventcalendar-event-mark`: Selected marker color - `--mbsc-eventcalendar-background-parent`: Timeline parent row background - `--mbsc-eventcalendar-background-parent-hover`: Timeline parent row hover - `--mbsc-eventcalendar-disabled-bg-color`: Disabled day background - `--mbsc-eventcalendar-disabled-text`: Disabled day text - `--mbsc-eventcalendar-success`: Success state color - `--mbsc-eventcalendar-error`: Error state color ### Material theme These variables apply when the `material` theme is active. - `--mbsc-eventcalendar-accent`: Primary accent / selected day - `--mbsc-eventcalendar-bg-color`: Calendar background - `--mbsc-eventcalendar-text-color`: Default text color - `--mbsc-eventcalendar-border-color`: Grid / separators - `--mbsc-eventcalendar-event-color`: Event background - `--mbsc-eventcalendar-event-mark`: Selected marker color - `--mbsc-eventcalendar-event-text`: Event text color - `--mbsc-eventcalendar-on-accent`: Text/icons on accent background - `--mbsc-eventcalendar-event-shadow`: Shadow color for events (e.g. selected or dragged events) - `--mbsc-eventcalendar-popup-bg-color`: Event popup background - `--mbsc-eventcalendar-time-color`: Time labels and secondary text color - `--mbsc-eventcalendar-disabled-bg-color`: Disabled day background - `--mbsc-eventcalendar-parent`: Timeline parent row background - `--mbsc-eventcalendar-parent-hover`: Timeline parent row hover - `--mbsc-eventcalendar-focus`: Focus outline color - `--mbsc-eventcalendar-success`: Success state color - `--mbsc-eventcalendar-error`: Error state color - `--mbsc-eventcalendar-schedule-text-color`: Schedule view text color --- ## Data binding { value: 'Local Data', level: 2, id: 'local-data'}, { value: 'Remote Data', level: 2, id: 'remote-data'}, { value: 'On demand loading', level: 2, id: 'on-demand-loading'} ]; The Eventcalendar accepts an array of event objects through the [`data`](api#opt-data) option of the component. The event array can be either a local static array, or populated on demand with remote requests. ## Event data structure The events of the Eventcalendar are specified as an array of event objects. The event object supports the following properties: - `id` _String, Number_ - A unique id for the event. If not specifed, the event will get a generated id. - `start` _Date, String, Object_ - Specifies the start of the event. - `end` _Date, String, Object_ - Specifies the end of the event. - `title` _String_ - The title of the event. - `color` _String_ - The color of the event. - `allDay` _Boolean_ - Specifies if the event is all day or not. - `editable` _Boolean_ - specify if an event is editable or not. Setting it to false disables drag & drop, resize and delete, 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. - `dragBetweenResources` _Boolean_ - specifies whether the event is movable across resources. It applies for [scheduler](scheduler) and [timeline](timeline) views. Has precedence over the `eventDragBetweenResources` property of the [resource](resources) and the [`dragBetweenResources`](api#opt-dragBetweenResources) option. - `dragInTime` _Boolean_ - specifies whether the event is movable in time. Has precedence over the `eventDragInTime` property of the [resource](resources) and the [`dragInTime`](api#opt-dragInTime) option. - `resize` _Boolean_ - specifies whether the event is resizable. Has precedence over the `eventResize` property of the [resource](resources) and the [`dragToResize`](api#opt-dragToResize) option. - `resource` _String, Number, Array_ - specify resource ids for the events. The event will display only in the specified [resource](resources) group. If there is no resource id defined the event will be displayed at every resource group. - `slot` _String, Number_ - specify slot ids for the events. The event will display only in the specified [`slot`](api#opt-slots) group. If there is no slot id defined the event will be displayed at every slot group. - `recurring` _String, Object_ - Recurrence rule for the event. - `recurringException` _String, Object, Array_ - Represents the exceptions of a recurring event. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule` _String, Object_ - Represents the exception rule of a recurring event. Useful when recurring dates need to be skipped from the rule. - `timezone` _String_ - The timezone of the event. When specified, it takes precedence over [`dataTimezone`](api#opt-dataTimezone). A timezone plugin must be also passed to the component. - `tooltip` _String_ - Specifies the tooltip text of the event. - `cssClass` _String_ - Can be used to pass custom CSS classes on an event to event basis. Useful when customization is needed on the event level. For example: setting the width for specific events. - `bufferBefore` _Number_ - Defines a buffer time in minutes that will be displayed before the start of the event. This buffer area can help you visualise delays or added minutes for tasks. For example travel time for meetings/appointments, briefing before flight, check in time on duty card. - `bufferAfter` _Number_ - Defines a buffer time in minutes that will be displayed after the end of the event. This buffer area can help you visualise delays or added minutes for tasks. For example travel time after meetings/appointments, debriefing after flight, check out time on duty card. ```javascript title="Simple event object" const myMeeting = { start: "2023-07-14T08:00", end: "2023-07-14T09:00", title: "Meeting with Jenny", }; ``` :::info The dates in the above structure can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects. ::: ```javascript title="Using date object in event objects" const myBirthday = { // highlight-next-line start: new Date(1988, 5, 28), // 1988 June 28th allDay: true, recurring: { repeat: "yearly", }, title: "My Birthday", }; ``` :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: The event objects may have additional custom properties as well. The custom properties are not used by the eventcalendar, but they are kept and will be available anywhere the event objects are used. E.g. the [`onEventClick`](api#event-onEventClick) event will receive the event object as argument, containing the custom properties as well. ```javascript title="Event object with custom properties" const weeklyMeeting = { start: '2023-07-26T15:45', end: '2023-07-26T16:00', title: 'Daily summary', // highlight-start address: 'Main Street 64' videoUrl: 'https://myaddress.com/location', recipients: ['Jack', 'Sam', 'Teal`c'] // highlight-end } ``` ## Recurring events The `recurring`, `recurringException` and `recurringExceptionRule` properties of the event object are used to define events that happen again over time. Check out the [recurrence section](../core-concepts/recurrence) for a more comprehensive description on recurring rules. ## Local data To bind local data to the event calendar, you can simply assign a JavaScript array of objects to the [`data`](api#opt-data) option of the component. ```html ``` ## Remote data You can load the data through an external request and assign it to the data option of the component. ```html ``` ## On demand loading Use the [`@page-loading`](api#event-onPageLoading) event to load the data relevant to the currently active view. The event fires every time the date range of the view changes, for example when someone navigates the event calendar. Getting the events in real time as the user interacts with the UI improves load performance and always serves the most recent data. :::tip You can pass the view variables - like month and year - in the URL and handle the filtering inside the API implementation. ::: ```html ``` In case of the timeline view, data can also be [loaded dynamically during scrolling](timeline#load-data-on-scroll). Scrolling vertically or horizontally triggers the [@virtual-loading](#event-onVirtualLoading) lifecycle event, which can be used to [load data incrementally during scrolling](https://demo.mobiscroll.com/timeline/load-resources-on-scroll). --- ## Drag & drop { value: 'Draggable', level: 3, id: 'draggable'}, { value: 'Draggable options', level: 3, id: 'draggable-options'}, { value: 'Third party dragging support', level: 3, id: 'third-party-dragging-support'}, { value: 'The Eventcalendar as source', level: 2, id: 'the-eventcalendar-as-source'}, { value: 'Dropcontainer', level: 3, id: 'dropcontainer'}, { value: 'Dropcontainer events', level: 3, id: 'dropcontainer-events'}, { value: 'Drop to third party drag&drop list', level: 3, id: 'third-party-dropping-support'}, ]; Calendar events can be created, moved and resized on the Eventcalendar. Furthermore it is possible to drag and drop events from an external source or to drag and drop to an external target from the Eventcalendar. The following sections describe how these solutions can be implemented and used. ## Internal drag/resize/create The events on the Eventcalendar can be moved and resized with mouse/touch interactions. The [`dragToMove`](./api#opt-dragToMove) and [`dragToResize`](./api#opt-dragToResize) options enable the events drag and drop and resize functionality. With the [`dragTimeStep`](./api#opt-dragTimeStep) option the minimum amount of drag/resize step can be specified in minutes. With the [`dragToCreate`](./api#opt-dragToCreate) option enabled, events can be created by dragging on the empty areas of the Eventcalendar. On a desktop environment a new event can also be created with the [`clickToCreate`](./api#opt-clickToCreate) option. To customize the newly created event use the [`extendDefaultEvent`](./api#opt-extendDefaultEvent) option. ![Eventcalendar move/resize/create](/img/v6/drag-resize-create.gif) ## Targeting the Eventcalendar There is a possibility to drag & drop any external element into your calendar. In order to achieve this, first you need to grant permission to your calendar to accept this behavior. You can do that by setting the [`externalDrop`](./api#opt-externalDrop) option to `true`. As a second step, you'll have to create your external draggable element and pass a skeleton event definition through the `dragData` option which will be added to the Eventcalendar on drop. If omitted, a default event will be created. ### Draggable You can initialize the draggable containers by using the `` component and reference the draggable container in the `element` option. ```html ``` ### Draggable options ### context string | HTMLElement Specify where the dragged element will be appended in the DOM. ### dragData string | [MbscCalendarEvent](#type-MbscCalendarEvent) | [MbscResource](#type-MbscResource) The data of the dragged element. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. The [`MbscResource`](#type-MbscResource) type has the following properties: - `background`: *string* - Specifies the background color of the resource row or column. - `children`: *Array<[MbscResource](#type-MbscResource)>* - Child resources. - `collapsed`: *boolean* - Specifies the displayed state of the child resource group. - `color`: *string* - Specifies the default event color 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. - `cssClass`: *string* - Specifies a css class for the resource row or column. - `eventCreation`: *boolean* - Disables event creation on specific resources by setting it to false. Defaults to true. - `eventDragBetweenResources`: *boolean* - Specifies whether the events in this resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the [dragBetweenResources](#opt-dragBetweenResources) option. - `eventDragBetweenSlots`: *boolean* - Specifies whether the events in this slot are movable across slots. Has precedence over the [dragBetweenSlots](#opt-dragBetweenSlots) option. - `eventDragInTime`: *boolean* - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventOverlap`: *boolean* - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize`: *boolean* - Specifies whether the events in this resource are resizable. Has precedence over the [dragToResize](#opt-dragToResize) option. - `fixed`: *boolean* - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-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 dra & rop and event creation functionalities to work properly. - `id`: *string | number* - The id of the resource. - `name`: *string* - Specifies the name of the resource. - `reorder`: *boolean* - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. ### element null | HTMLElement The HTML element of the dragged item. ### type "resource" | "event" The type of the draggable element. ### Third party dragging libraries Mobiscroll comes with built-in support for two widely used reorderable drag-and-drop list libraries: [SortableJS](https://sortablejs.github.io/Sortable/) and [Dragula](https://bevacqua.github.io/dragula/). With the `sortableJsDraggable` and `dragulaDraggable` plugins, you can seamlessly drag items into the Eventcalendar with just a few lines of code. #### SortableJS: Integration: call the `sortableJsDraggable` plugin’s `init()` method and pass the SortableJS instance along with the `options` object. The options object can include the following properties: - `cloneSelector` - *string* - the selector of the SortableJS clone element, typically `'.sortable-drag'` - `dragData` - *(el: HTMLElement) => MbscCalendarEvent | MbscResource* - function to build the resource or event object. Defaults to `data-drag-data` attribute on the element. - `type` - *'event' | 'resource'* - Creates an event or resource on the Eventcalendar. Defaults to `'event'`. - `externalDrop` - *boolean* - Enables drop from Eventcalendar to SortableJS list. - `onExternalDrop` - *(args: {container: HTMLElement, position: number, dragData: MbscCalendarEvent | MbscResource, afterElement?: HTMLElement}) => void* - function triggered on drop from Eventcalendar to SortableJS list. ```html ``` :::info The SortableJS integration works only if fallback mode is used. The `cloneSelector` must be set in the `options` object. ::: #### Dragula: Integration: call the `dragulaDraggable` plugin’s `init()` method and pass the Dragula instance, optionally providing an `options` object to customize the behavior. The options object can include the following properties: - `dragData` - *(el: HTMLElement) => MbscCalendarEvent | MbscResource* - function to build the resource or event object. Defaults to `data-drag-data` attribute on the element. - `type` - *'event' | 'resource'* - Creates an event or resource on the Eventcalendar. Defaults to `'event'`/docs- `externalDrop` - *boolean* - Enables drop from Eventcalendar to Dragula list. - `onExternalDrop` - *(args: {container: HTMLElement, position: number, dragData: MbscCalendarEvent | MbscResource, afterElement?: HTMLElement}) => void* - function triggered on drop from Eventcalendar to Dragula list. ```html ``` :::info When using the Dragula integration on touch devices, draggable items require the following CSS rule to ensure proper behavior: `.task { touch-action: none; }` This is a known limitation in Dragula’s touch support that has not been addressed yet. ::: ## The Eventcalendar as source The [`externalDrag`](./api#opt-externalDrag) option enables events to be dragged out from the calendar/schedule/timeline views and dropped on another instance of the Eventcalendar or any [Dropcontainer](#dropcontainer). When an event leaves the Eventcalendar the [`@event-drag-leave`](./api#event-onEventDragLeave) life-cycle event will be fired and a clone of the calendar event will be displayed for a better illustration of the movement. If the [`dragToMove`](./api#opt-dragToMove) option is not enabled the dragged event will instantly leave the calendar container and the [`@event-drag-leave`](./api#event-onEventDragLeave) event will fire and the event clone will be displayed. When an event enters the Eventcalendar the [`@event-drag-enter`](./api#event-onEventDragEnter) life-cycle event will be fired. ### Dropcontainer The Dropcontainer defines a container where events can be dragged from or dropped to. The [`@item-drag-leave`](#event-onItemDragLeave) and [`@item-drag-enter`](#event-onItemDragEnter) life-cycle events can be used to track when an event exits or enters the Dropcontainer. When an item is dropped inside the container the [`@item-drop`](#event-onItemDrop) event is triggered. This can be useful for unscheduling work or appointments that were already scheduled. ```html ``` ### Dropcontainer events ### @destroy (args: any, inst: any) => void Triggered when the component is destroyed. Parameters: - args - The event argument object. - 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. ### @item-drag-enter (args: MbscItemDragEvent) => void Triggered when an event is dragged into the calendar/timeline/scheduler view. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event of the drag. - `data`: *MbscCalendarEvent | MbscResource * - The dragged data. - `dataType`: *'event' | 'resource'* - The type of the dragged item. ### @item-drag-leave (args: MbscItemDragEvent) => void Triggered when an event is dragged into the calendar/timeline/scheduler view. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event of the drag. - `data`: *MbscCalendarEvent | MbscResource * - The dragged data. - `dataType`: *'event' | 'resource'* - The type of the dragged item. ### @item-drop (args: MbscItemDragEvent) => void Triggered when an event is dropped inside the drop container. Parameters: - args - The event argument with the following properties: - `domEvent`: *Event* - The DOM event of the drag. - `data`: *MbscCalendarEvent | MbscResource * - The dragged data. - `dataType`: *'event' | 'resource'* - The type of the dragged item. ### Drop to third party drag&drop list Mobiscroll comes with built-in support for dropping events and resources from the Eventcalendar to two of the most popular reordable drag and drop lists: [SortableJS](https://sortablejs.github.io/Sortable/) and [Dragula](https://bevacqua.github.io/dragula/). Unscheduling events or drag out resources can be enabled with the `sortableJsDraggable` and `dragulaDraggable` plugins. Integration: enable dropping to third-party lists by setting `externalDrop` to `true` in the `sortableJsDraggable` or/and `dragulaDraggable` plugin’s `options` configuration and use the `onExternalDrop` callback to update the list. This function returns the following arguments: - `afterElement` - *HTMLElement* - the list element before which the clone is dropped. - `container` - *HTMLElement* - the list container. - `dragData` - *MbscCalendarEvent | MbscResource* - the dragged data. - `position` - *number* - the index where the clone is dropped. ```ts import { MbscExternalDropEvent } from '@mobiscroll/vue'; import '@mobiscroll/vue/dist/css/mobiscroll.min.css'; // options object of the sortableJsDraggable or dragulaDraggable // enable drop from Eventcalendar to Dragula or SortableJS list externalDrop: true, // update the list items after drop event onExternalDrop: (args: MbscExternalDropEvent) => { const listItems = [...myListItems.value] listItems.splice(args.position, 0, args.dragData) myListItems.value = listItems }, ``` --- ## Navigating to a date and time You can navigate to another view programatically any time, by changing the [`selectedDate`](./api#opt-selectedDate) option. This will navigate the calendar to the view containing the specified date. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. When multiple days, weeks, months or years are displayed, the position of the specified date on the view (first, second, third, etc. day/week/month/year) is determined by the [`refDate`](./api#opt-refDate) option. ```html ``` --- ## Eventcalendar The Eventcalendar component supports four highly configurable views: a [Calendar view](/vue/eventcalendar/calendar), a [Sheduler with time grid](/vue/eventcalendar/scheduler), a [Timeline](/vue/eventcalendar/timeline) and an [Agenda view](/vue/eventcalendar/agenda). ## Usage The following example will create an Eventcalendar with the default options. ```html ``` For many more examples - simple and complex use-cases - check out the [Eventcalendar demos](https://demo.mobiscroll.com/eventcalendar). --- ## Print { value: 'Printing', level: 2, id: 'printing'}]; The Print Module is an optional module, that includes styles and functions for printing. It can be installed and used with the Mobiscroll Eventcalendar. ## Installing the Print Module When your Mobiscroll package is created with the [Download Builder](https://download.mobiscroll.com) and you have access to the Print Module, you can choose to include it in the built package. In this case you will need make sure you checked the print module before downloading the package from the download page. After installing your downloaded package, the Print Module will be available for import. In case it was downloaded with the download builder, the Print Module needs to be imported from the generated package. When you're using the full Mobiscroll package from NPM, then you have the possibility to install the Print Module as an additional package (also from NPM). In this case, after successfully using the Mobiscroll CLI to configure the project, you will have to install the `@mobiscroll/print` package from npm. Use the following command: ```bash npm install @mobiscroll/print ``` ## Importing the Print Module The Print Module consists of print specific styles, that need to be loaded into the document. Also, there's a JavaScript part, that needs to be imported and passed to the component via the [`modules`](./api#opt-modules) option. #### Stylesheets :::info In the case of the package built by the download builder, there's no additional stylesheet. It is already bundled into the same file all the other component files are. ::: For the NPM package, styles can be found at the `dist/css/` folder inside the package. ```javascript // importing the css import '@mobiscroll/print/dist/css/mobiscroll.min.css'; // importing the SASS - if you are using SASS import '@mobiscroll/print/dist/css/mobiscroll.scss'; ``` #### JavaScript The print module can be imported from the installed package and passed to the component using the [modules](./api#opt-modules) option. Here's an example: ```html ``` ## Printing Printing the Eventcalendar contents can be done using the print method of the Eventcalendar [instance](../core-concepts/instance). Calling this method will create a new window containing only the Eventcalendar and will invoke the print function of the browser. After the printing is done, the window should close automatically. :::info When you want to include more than just the Eventcalendar in your print, you can invoke the print screen of your browser. You don't have to worry about the printing styles for the eventcalendar, they will be applied in this case as well. ::: The new window created by the print method will include all the styles and links to stylesheets from the original page. These styles will be copied over automatically, but in case you are using relative urls, the base url of the new window might not match yours. In this case, the print method can be passed a config object, with your custom `baseUrl`, to make the relative paths work. By default, the `baseUrl` will be the original pages origin. :::caution Popup blockers might block the created window, so you need to disable the blocker for this method to work. ::: ```html ``` :::info If you want to learn more about calling instance methods check out the [instance](../core-concepts/instance) section! ::: --- ## Resources Resources can be many things, ranging from **people** through **conference rooms** to **company assets**, that need schedulig. The Eventcalendar can handle multiple resources inside a single instance. The resource object supports the following properties: - `background` _String_ - Specifies the background color of the resource row or column. - `children` _Array of object_ - Array of resource objects which will render as a child of the specified resource. - `collapsed` _Boolean_ - Defines the displayed state of the child resoruce group. - `id` _Number, String_ - This is an id that can be referenced in the events/invalids/colors data. - `name` _String_ - The name of the resource that will be displayed at the top of the resource column. - `color` _String_ - The color controls the default event color of the resource. Event colors can be specified further on the event object itself. If the color is omitted the events of the resource will inherit the default calendar color. - `fixed` _Boolean_ - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-view) option is not given, or it's value is set to `none`. - `eventCreation` _Boolean_ - Disables 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 and has precedence over [`dragBetweenResources`](api#opt-dragBetweenResources) option. - `eventDragBetweenSlots` _Boolean_ - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventDragInTime` _Boolean_ - Specifies whether the events in the specified resource are movable in time. Has precedence over the [`dragInTime`](api#opt-dragInTime) option. - `eventOverlap` _Boolean_ - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize` _Boolean_ - Specifies whether the events in the specified resource are resizable. Has precedence over [`dragToResize`](api#opt-dragToResize) option. - `reorder` _Boolean_ - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. Has precedence over the `resourceReorder` property. Besides the base properties you can add any custom property, like title, job, etc. ```javascript title="Defining resources" const myResources = [ { id: "my_id_1", name: "Jane", job: "Developer" }, { id: "my_id_2", name: "Bob", job: "Administrator" }, { id: "my_id_3", name: "Andy", job: "Designer" }, ]; ``` :::tip For more information on resource grouping and hierarchy check out the [timeline's](timeline#resource-grouping-and-hierarchy) or the [scheduler's](scheduler#resource-grouping) sections for resources. ::: [Events](api#opt-data), [colors](api#opt-colors), [invalids](api#opt-invalid) can be tied to a single or multiple resources. This can be done with the `resource` property of the objects, where the id of the resource should be passed. It can be a single value and the element would be linked to a single resource or in case of an array the element will show up at the specified resources. If no resource property is specified to the color/event/invalid object then the element will show up in every resource group. ```javascript title="Invalid rule for specific resources" const myResources = [ { id: 1, name: 'General Courier'}, // highlight-start { id: 2, name: 'Express Courier'}, { id: 3, name: 'Super Express Courier'}, // highlight-end ]; const myInvalid = [ { // highlight-next-line resource: [2, 3] // is unavailable at weekends: recurring: { repeat: 'weekly', weekDays: 'SU,SA', interval: 1 } } ]; ``` :::tip Check out the [recurrence section](../core-concepts/recurrence) for more details on recurring rules ::: --- ## Scheduler # Scheduler Use the [Scheduler view](https://demo.mobiscroll.com/scheduler) which features a time grid - vertically scrollable [daily, weekly and monthly views](https://demo.mobiscroll.com/scheduler/show-hide-hours-days) with built in [resource support](https://demo.mobiscroll.com/scheduler/resource-view), [templating](#templating) and more. ## Overview The Scheduler displays a time grid with its related events. It can be configured as a [daily, weekly or monthly schedule](https://demo.mobiscroll.com/scheduler/show-hide-hours-days). [Work hours and work days](https://demo.mobiscroll.com/scheduler/work-week-hours) along with [disabled time-spans, breaks](https://demo.mobiscroll.com/scheduler/time-off-blocked-ranges) can be added. Use it for [advanced scheduling tasks](https://demo.mobiscroll.com/scheduler/doctors-appointment) with built-in drag & drop. The capabilities like [recurring events](/vue/core-concepts/recurrence), [all-day, multi-day events](#opt-data), [responsiveness](#responsiveness) are supported by the Scheduler. ![Scheduler overview](/img/v6/scheduler-overview.png) ## Showing the Scheduler ### View combination The four views - [scheduler](./scheduler), [calendar](./calendar), [timeline](./timeline), [agenda](./agenda) - can be used alone or combined with each-other to create the perfect user experience on mobile, desktop and on everything in-between. For example, the daily Scheduler can also be combined with the Calendar week view. The view option will look like the following: ```html title="Daily Scheduler combined with Weekly Calendar" ``` ### Configuring the view The Scheduler view can be configured through the `view` option. Below are listed the `scheduler` object properties which can help you fine-tune this view. ```html title='Example' ``` ### allDay boolean Show or hide the all day events. **Default value**: `true` ### currentTimeIndicator boolean Show or hide the current time indicator. It defaults to `true` when the resolution is less than a day otherwise defaults to `false`. ### days boolean Show or hide week days above the scheduler grid. **Default value**: `true` ### endDay number Specifies the last visible weekday of the view. Sunday is 0, Monday is 1, etc. Days outside of the `startDay` and `endDay` range will not be visible. **Default value**: `6` ### endTime string Set the end time of scheduler column. Hours, minutes and an optional positive day offset can be specified in the same string. - Standard format: 'HH:MM' (e.g., `'18:30'`). - Offset format (extends the view N days after): 'HH:MM+N' (e.g., `'08:00+1'`). **Default value**: `'24:00'` ### hideEmptyColumns boolean Hide the empty columns. **Default value**: `false.` ### hideInvalidColumns boolean Hide the fully invalid columns. **Default value**: `false.` ### maxEventStack number | "auto" | "all" Limit the number of displayed events. When the number of overlapping events reaches the specified value, a "more" button will be displayed which opens a popover showing the rest of the events. - If it is a `number`, it specifies how many events will be displayed before the "more" button appears. - If set to `'all'`, all events will be displayed. - If set to `'auto'`, the component will decide how many events can be placed inside the column, based on the `minEventWidth` view option and the actual column width. **Default value**: `'all'` ### minEventWidth number Specifies the minimum event width. Will be used when `maxEventStack: 'auto'` is used. ### size number Specifies the number of displayed months, weeks or days. **Default value**: `1` ### startDay number Specifies the first visible weekday of the view. Sunday is 0, Monday is 1, etc. Days outside of the `startDay` and `endDay` range will not be visible. Should not be mistaken for the [firstDay](#localization-firstDay) option, which sets the first day of the week, and, if not set, is defined by the [localization](#localization-locale). **Default value**: `0` ### startTime string Set the start time of scheduler column. Hours, minutes and an optional negative day offset can be specified in the same string. - Standard format: 'HH:MM' (e.g., `'09:30'`). - Offset format (initiates the view N days prior): 'HH:MM-N' (e.g., `'20:00-1'`). **Default value**: `'00:00'` ### timeCellStep number Specifies the step of the grid cells in minutes. Supported values: 1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440 **Default value**: `60` ### timeLabelStep number Specifies the step of the time labels in minutes. Supported values: 1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440. **Default value**: `60` ### timezones Array 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](https://gist.github.com/aviflax/a4093965be1cd008f172). If no label is provided, the time column label will be UTC +/- the timezone offset. ```js timezones: ['Europe/Berlin','Europe/Bucharest'] ``` ```js timezones: [ { timezone: 'America/Chicago', label: 'CHI'}, { timezone: 'America/New_York', label: 'NY'} ] ``` ### type "month" | "day" | "week" Sets the scheduler type. **Default value**: `'week'` ### virtualScroll boolean Enable or disable virtual scroll. **Default value**: `true` ### Shifted days [Shifted views](https://demo.mobiscroll.com/scheduler/24-hour-manufacturing-shift-rota-planning) — can be implemented by extending the scheduler [view](#configuring-the-view) with hours from the previous or next calendar days using the startTime and endTime properties with a day-offset format. ![Scheduler shifted days](/img/v6/scheduler-shifted-view.png) #### Shift Start Time (Previous Day Offset) Use a negative day offset (HH:MM-D) to show hours from the previous day (e.g., '20:00-1'). #### Shift End Time (Next Day Offset) Use a positive day offset (HH:MM+D) to extend the view into the next day (e.g., '06:00+1'). ```ts view: { schedule: { type: 'week', // Starts the view at 20:00 on the previous day startTime: '20:00-1', // Ends the view at 06:00 on the next day endTime: '06:00+1' } } ``` ### Row height There might be cases when you would like to change the height of the schedule cell. You can use the following CSS classes for this purpose: ```css .mbsc-schedule-time-wrapper, .mbsc-schedule-item { height: 20px; } ``` ### Column width CSS classes offer the flexibility to adjust column widths, allowing you to fully customize the layout of both resource columns and day columns. You can choose to customize them together or separately, giving you the freedom to create a design that suits your specific needs. ```css title="Setting general column width" .mbsc-schedule-col-width { width: 100px; } ``` #### Customizing weekday column widths Each weekday column has a predefined CSS class that allows setting different widths for them: - `.mbsc-schedule-column-mon` (Monday) - `.mbsc-schedule-column-tue` (Tuesday) - `.mbsc-schedule-column-wed` (Wednesday) - `.mbsc-schedule-column-thu` (Thursday) - `.mbsc-schedule-column-fri` (Friday) - `.mbsc-schedule-column-sat` (Saturday) - `.mbsc-schedule-column-sun` (Sunday) ```css title="Adjusting width for Monday" .mbsc-schedule-column-mon { width: 150px; } ``` #### Customizing resource column widths Resource column widths can be adjusted by assigning a custom CSS class to resources using the cssClass property. Check out how to change resource column widths in [this example](https://demo.mobiscroll.com/scheduler/content-dependent-resource-width). ```ts title="Assigning a class to a resource" resources: [ { id: 1, name: 'Resource 1', cssClass: 'resource-column-small' }, { id: 2, name: 'Resource 2', cssClass: 'resource-column-large' } ] ``` ```css title="Define styles for the resource classes" .resource-column-small { width: 80px; } .resource-column-large { width: 160px; } ``` :::info If you override both resource and day column widths, make sure column groups (day or resource, depending on the [`groupBy`](#opt-groupBy) option) are wide enough to contain their child elements, or specify a `min-width` for the group column instead of a fixed width. ::: ### Hide empty columns Columns without any events can be hidden by setting `hideEmptyColumns` to `true` under the [view](#configuring-the-view) configuration. ### Hide invalid columns Fully invalid columns can be hidden by setting `hideInvalidColumns` to `true` under the [view](#configuring-the-view) configuration. :::info A column is considered fully invalid if it contains [invalid](#opt-invalid) periods defined with `allDay`, date values, or a single time range that covers a full day or multiple days. ::: ## Resources ### Resource grouping The Scheduler view can display multiple [resources](resources) inside a single instance. By default the displayed resources will be grouped by the given resources and the grouping can be changed with the [`groupBy`](#opt-groupBy) option, which also supports grouping by date. ```javascript title="Grouping resources by date" // highlight-next-line const myGrouping = 'date'; const myResources = [{ id: 1, name: 'Ryan', color: '#f7c4b4' }, { id: 2, name: 'Kate', color: '#c6f1c9' }, { id: 3, name: 'John', color: '#e8d0ef' }]; ``` ```html ``` The color property controls the default event color of the resource. If an event doesn't have a specified color it will inherit from the resource. The [agenda](agenda) and [calendar view](calendar) events and labels will also inherit the resource color. [Events](#opt-data), [colors](#opt-colors), [invalids](#opt-invalids) can be tied to a single or multiple resources. This can be done with the `resource` property of the objects, where the id of the resource should be passed. It can be a single value where the element would be linked to a single resource or in case of an array the element will show up at all of the specified resources. If no resource property is specified to the color/event/invalid object then the element will show up in every resource group. ```html ``` ```javascript title="Invalid rule tied to a single resource" const myInvalidRules = [{ // highlight-next-line resource: 1, // this invalid will be displayed only in resource group where id is 1 start: '13:00', end: '12:00', recurring: { repeat: 'weekly', weekDays: 'MO,TU,WE,TH,FR' }, title: 'Lunch break' }]; ``` ```javascript title="Event tied to multiple resources" const myEvents = [{ // highlight-next-line resource: [2, 3] // this event will be displayed in resource groups where id is 2 and 3 start: new Date(2021, 5, 23), end: new Date(2021, 5, 30), title: 'Conference', allDay: true, }]; ``` ```javascript title="Color rule for all the resources (resource not specified)" const myColors = [ { // highlight-next-line // this color will display at every resource group start: new Date(2021, 5, 12, 16), end: new Date(2021, 5, 12, 17), color: "green", }, ]; ``` ### Resource order The initial order in which the resources appear on the scheduler follows the order of the array passed to the component. If the initial order needs to be changed, sort the resource array before passing it to the event calendar. For dynamic sorting during runtime, sort the resource array and pass the updated array to the calendar. ## Load data on scroll The scheduler view is virtualized, meaning its markup is dynamically generated and managed as needed. Scrolling vertically or horizontally triggers the [onVirtualLoading](#event-onVirtualLoading) lifecycle event, which can be used to load data incrementally during scrolling, rather than loading all data during the initial render. This dramatically improves performance in case of a large event or resource count since not all data is loaded in memory from start. ## Responsiveness The Scheduler is [fully responsive](https://demo.mobiscroll.com/scheduler/responsive-day-week-schedule#). It adapts to the available space and fills the screen to look good everywhere. While you don't have to worry about the width the height can be manually adjusted with the [height](#opt-height) option. This 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. Use the [responsive](#opt-responsive) option to configure how the calendar behaves on different sized screens. The responsive option is equipped with five breakpoints: - `xsmall` (up to 575px), - `small` (up to 767px), - `medium` (up to 991px), - `large` (up to 1199px), - `xlarge` (from 1200px). Also, custom breakpoints can be added if necessary: - `my-custom-breakpoint: { breakpoint: 600 }` (from 600px up to the next breakpoint). :::info The available width is queried from the container element of the component and not the browsers viewport like in css media queries. ::: ```html title='Responsive configuration with the view option' ``` ![Scheduler responsive behavior](/img/v6/scheduler-responsive.gif) ## Templating The display of Scheduler can be customized with different [solt functions](#slots). ### The cell Use the [cell](#slot-cell) slot to fully customize the Scheduler cells. Customize how the cell look and what they show. The slot gets an object with properties like date, events, colors, invalids, and resource, which can be used to display custom content. :::info Since cells are rendered frequently while scrolling, keep the customization lightweight for best performance. ::: Check out how you can style the cell in [this example](https://demo.mobiscroll.com/scheduler/cell-content-template#) or just play with the slider below to see the differences. ### The event, their content and buffer areas The events can be customized in two ways: - You can use the [schedulerEvent](#slot-schedulerEvent) option to customize the events that appear on the Scheduler. It should return the markup of the event. The Eventcalendar will take care of the positioning, but anything else you want to show is up to you - like a title, description, color the background or show any content. - If you are looking to customize only the content and don't want to bother with the styling of the event, you can use the [schedulerEventContent](#slot-schedulerEventContent) option. Mobiscroll will position the event to the right place and will render essential information like the color of the event, the time and if it's an all day event or not. The title, description and any other fields you want to show (like participants or an avatar) will be coming from your custom function. The buffers can be customized through the [bufferBefore](#slot-bufferBefore) and [bufferAfter](#slot-bufferAfter) options. These can help you visualise delays or added minutes for tasks. For example travel time for meetings/appointments, check in/check out for flights. Check out how you can style event, their content and buffer areas in [this example](https://demo.mobiscroll.com/vue/scheduler/customizing-events#) or just play with the slider below to see the differences. ### The date header There are two approaches you can take: - Customize the date headers of the Scheduler with the [schedulerDay](#slot-schedulerDay) option by adding relevant content, labels or completely change how they look. It takes a function that should return the desired markup. The Eventcalendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you. The render function will receive an object as parameter. This data can be used to show day specific things on the Scheduler. - If you are looking to customize only the content and don't want to bother with the styling of the event, you can use the [schedulerDayContent](#slot-schedulerDayContent) option. You will get the styling taken care of by the Eventcalendar, and you can focus on what you show besides the day number. The template will receive an object as data. This data can be used to show day specific things on the Scheduler. Check out how you can style the date header in [this example](https://demo.mobiscroll.com/vue/scheduler/date-header-template#) or just play with the slider below to see the differences. ### The resource header Use the [resource](#slot-resource) option to customize the resource template of the Scheduler. Customize how the resource headers look and what they show. Utilize properties passed in the [resources](#opt-resources) array. It takes a function that should return the desired markup. In the returned markup, you can use custom html as well. Check out how you can style the resources in [this example](https://demo.mobiscroll.com/vue/scheduler/custom-resource-header-template#) or just play with the slider below to see the differences. ### The scheduler header Customize how the header of the Scheduler looks and how the components are arranged with the [header](#slot-header) option. It takes a function that should return the desired markup. In the returned markup, you can use custom html as well as the built in header components of the calendar. While fully customizing the header is very usefull, sometimes it's desireable to customize only parts of it. In this case you can take advantage of the default header's [building blocks](/vue/eventcalendar/templating#header-templating). These components let you put toghether the header you want, while you don't have to worry about the functionality behind them. Check out how you can style the header in [this example](https://demo.mobiscroll.com/vue/scheduler/customizing-header#) or just play with the slider below to see the differences. ## Event order The rendered event order is determined by the following two concepts: 1. Event data order 2. Event layout The combination of these concepts results in the final rendered event order. ### Event data order The sequence in which events are processed before being passed to the layout algorithm. The default ordering rules are as follows: 1. All-day events are placed at the top. 2. Non-all-day events follow, sorted by their start times. 3. Events with the same start time are further ordered alphabetically by their titles. This default order can be modified using the `order` property in the event [event data](#opt-data). The order property takes precedence over the default rules. If two events have the same order value, the default rules apply. For more complex ordering requirements, the [eventOrder](#opt-eventOrder) option can be used. This option accepts a function that compares two events and returns an order (-1 or 1). ### Event layout The event layout process determines the visual positioning and dimensions of events. This is a built-in functionality and cannot be altered externally. The layout algorithm processes the sorted event list and calculates each event's position and size. The algorithm follows these steps: 1. The first event is placed in the first position of the event track. 2. If two or more events overlap in their start/end times, the later event is placed in the next event track, positioned below or next to the previous event. 3. If a subsequent event does not overlap with any already added events, it is placed back in the first event track. 4. This process continues until all events are positioned within their respective columns or rows. ## API Here is a comprehensive list of all the specific options, events and methods of the Scheduler view. ### Options Explore the following API options that help you easily configure the Scheduler. ### 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](#opt-dragToCreate) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-eventDelete) option. **Default value**: `undefined` ### colors Array<[MbscCalendarColor](#type-MbscCalendarColor)> Specifies the color for certain dates or date ranges on the calendar. The [`MbscCalendarColor`](#type-MbscCalendarColor) type 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. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. :::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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The colors can be combined with the [labels](#opt-labels) or [marked](#opt-marked) options. ::: ```js [ { 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` ### context string | HTMLElement The DOM element in which the popups (event popover, year and month picker) are rendered. Can be a selector string or a DOM element. **Default value**: `'body'` ### cssClass string Specifies a custom CSS class for the component. **Default value**: `undefined` ### data Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> The events for the Eventcalendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::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-onEventClick) event will receive the event object as argument, containing the custom properties as well. ::: :::info Use the [getEvents](#method-getEvents) method to get the events between two dates. ::: ```js 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](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. If not specified, it defaults to the [displayTimezone](#opt-displayTimezone). **Default value**: `undefined` ### defaultSelectedDate [MbscDateType](#type-MbscDateType) Specifies the initial selected date on the calendar. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. **Default value**: `undefined` ### displayTimezone string The timezone in which the data is displayed. :::info When using timezones, the [exclusiveEndDates](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), 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](#opt-dragInTime) option. Consider that [dragToMove](#opt-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](#opt-dragBetweenResources) option. Consider that [dragToMove](#opt-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` ### dragTimeStepBase "viewStart" | "dayStart" Specifies the base of the [dragTimeStep](#opt-dragTimeStep) calculation. If set to `'viewStart'` it takes the `startTime` property of the [view](#opt-view) option as reference. **Default value**: `'dayStart'` ### 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](#opt-newEventText) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-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](#opt-clickToCreate) and [dragToCreate](#opt-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](#type-MbscCalendarEvent), event2: [MbscCalendarEvent](#type-MbscCalendarEvent)) => number Determines the ordering of the events within the same day. Can be a function that accepts two event objects as arguments and should return -1 or 1. If not specified, the default order is: - all day events - rest of events, sorted by start time; events with identical start times, will be ordered alphabetically based on their title **Default value**: `undefined` ### 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) => void | [MbscCalendarEvent](#type-MbscCalendarEvent) Use this option to set properties to the new event created with click or drag. The event creation is handled by the [clickToCreate](#opt-clickToCreate) and [dragToCreate](#opt-dragToCreate) options. It takes a function that should return the properties for the new event. The argument object passed to this function has the following properties: - `start`: *Date* - The date when the newly created event will start. - `resource`: *string | number* - The id of the resource where the event creation started. ```js extendDefaultEvent: (args) => { return { color: args.resource === 'admin' ? 'green' : 'red', title: 'My event', }; } ``` **Default value**: `undefined` ### 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](#opt-data) by date or by [resource](#opt-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](#type-MbscDateType)> | Array<[MbscCalendarInvalid](#type-MbscCalendarInvalid)> 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* - 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* - Specifies the [resource](#opt-resources) 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](#opt-slots) 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. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: ```js [ // 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` The [`MbscCalendarInvalid`](#type-MbscCalendarInvalid) type has the following properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### invalidateEvent "start-end" | "strict" Specifies how to validate events against [invalid](#opt-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'` ### max [MbscDateType](#type-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](#opt-invalid) option with daily recurrence starting from the specific date. **Default value**: `undefined` ### min [MbscDateType](#type-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](#opt-invalid) option with daily recurrence until the specific date. **Default value**: `undefined` ### modules Array Additional modules can be added to the eventcalendar. The option receives an array of module objects. For example, the print module can be added through this option. ```js // import the print module import { print } from '@mobiscroll/print'; // later on, add it to the modules array: modules: [print] ``` ### refDate [MbscDateType](#type-MbscDateType) Specifies the reference date for the view calculation, when multiple days, weeks, months or years are displayed. If not specified, will be today's date. It denotes the reference point when calculating the pages going in the future and in the past. For example if the view type is day, the view size is 3, and the current date is `01/16/2024`, the pages are calculated from this date, so the initial page will contain `[01/16/2024, 01/16/2024, 01/17/2024]`, the next page `[01/18/2024, 01/19/2024, 01/20/2024]` and so on. In case of day view, the reference point will be exactly the specified date. For week, month and year views the reference point will be the start of the week, month or year of the specified day. Changing the reference date will not navigate the calendar to the specified date, it only recalculates the pages from the new reference date. To navigate the view to a specified date and time, use the [selectedDate](#opt-selectedDate) option. **Default value**: `undefined` ### resources null | Array<[MbscResource](#type-MbscResource)> The scheduler and timeline views can handle multiple resources. Resource grouping can be modified with the help of the [groupBy](#opt-groupBy) option. If set to `null` or `undefined`, all events will be displayed, regardless of their `resource` property. The timeline view will not display the resource column, if the resources option is not set. If set to an empty array, only those events will be displayed which are not tied to any resource. The timeline view will display an empty resource column when an empty array is passed. The timeline view can render multiple levels of hierarchy groups. Levels can be added with the help of the `children` property. The [`MbscResource`](#type-MbscResource) type has the following properties: - `background`: *string* - Specifies the background color of the resource row or column. - `children`: *Array<[MbscResource](#type-MbscResource)>* - Child resources. - `collapsed`: *boolean* - Specifies the displayed state of the child resource group. - `color`: *string* - Specifies the default event color 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. - `cssClass`: *string* - Specifies a css class for the resource row or column. - `eventCreation`: *boolean* - Disables event creation on specific resources by setting it to false. Defaults to true. - `eventDragBetweenResources`: *boolean* - Specifies whether the events in this resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the [dragBetweenResources](#opt-dragBetweenResources) option. - `eventDragBetweenSlots`: *boolean* - Specifies whether the events in this slot are movable across slots. Has precedence over the [dragBetweenSlots](#opt-dragBetweenSlots) option. - `eventDragInTime`: *boolean* - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventOverlap`: *boolean* - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize`: *boolean* - Specifies whether the events in this resource are resizable. Has precedence over the [dragToResize](#opt-dragToResize) option. - `fixed`: *boolean* - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-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 dra & rop and event creation functionalities to work properly. - `id`: *string | number* - The id of the resource. - `name`: *string* - Specifies the name of the resource. - `reorder`: *boolean* - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. ```js 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 [MbscResponsiveOptions](#type-MbscResponsiveOptions) 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, you can use multiple, but each must have a unique name 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](#type-MbscDateType) Specifies the selected date on the calendar. This can be changed programmatically and when changed the calendar will automatically navigate to the specified date. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. This does not change the reference date that defines the reference point of the navigation pages. To change the reference point for the navigation (e.g. start the paging from the newly selected date) use the [refDate](#opt-refDate) option. You also need to pass a handler for the [onSelectedDateChange](#event-onSelectedDateChange) event to update the selected date when the date is changed from the calendar. **Default value**: `undefined` ### selectedEvents Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Specifies the selected events on the calendar. The [onSelectedEventsChange](#event-onSelectedEventsChange) event will be fired when the selected events change from the calendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. **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` ### showEventBuffer boolean If `true`, it will display the event buffers defined in the [event data](#opt-data). **Default value**: `true` ### showEventTooltip boolean If `false`, it will hide the native tooltip that shows up when hovering over an event. **Default value**: `true` ### 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](../theming/sass-variables) or [create custom themes](../theming/sass-themes). :::info Make sure that the theme you set is included in the downloaded package. ::: **Default value**: `undefined` ### themeVariant "light" | "dark" | "auto" Controls which variant of the [theme](#opt-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 [MbscTimezonePlugin](#type-MbscTimezonePlugin) 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](https://momentjs.com/timezone/) and [luxon](https://moment.github.io/luxon/#/). You can specify either the [dataTimezone](#opt-dataTimezone) or the [displayTimezone](#opt-displayTimezone) or both. Depending on which external library you use you can pass either the `momentTimezone`, `dayjsTimezone` or `luxonTimezone` objects. These objects can be imported from the mobiscroll bundle. **Default value**: `undefined` The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - ### width string | number Sets the width of the component. **Default value**: `undefined` ### 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](#opt-dragToCreate) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-eventDelete) option. **Default value**: `undefined` ### colors Array<[MbscCalendarColor](#type-MbscCalendarColor)> Specifies the color for certain dates or date ranges on the calendar. The [`MbscCalendarColor`](#type-MbscCalendarColor) type 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. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. :::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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::info The colors can be combined with the [labels](#opt-labels) or [marked](#opt-marked) options. ::: ```js [ { 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` ### context string | HTMLElement The DOM element in which the popups (event popover, year and month picker) are rendered. Can be a selector string or a DOM element. **Default value**: `'body'` ### cssClass string Specifies a custom CSS class for the component. **Default value**: `undefined` ### data Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> The events for the Eventcalendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `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 For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: :::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-onEventClick) event will receive the event object as argument, containing the custom properties as well. ::: :::info Use the [getEvents](#method-getEvents) method to get the events between two dates. ::: ```js 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](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), e.g. `"America/New_York"`. If not specified, it defaults to the [displayTimezone](#opt-displayTimezone). **Default value**: `undefined` ### defaultSelectedDate [MbscDateType](#type-MbscDateType) Specifies the initial selected date on the calendar. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. **Default value**: `undefined` ### displayTimezone string The timezone in which the data is displayed. :::info When using timezones, the [exclusiveEndDates](#opt-exclusiveEndDates) option is also turned on by default. ::: :::info When using anything other than the default (`'local'`), a [timezone plugin](#opt-timezonePlugin) 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](https://gist.github.com/aviflax/a4093965be1cd008f172), 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](#opt-dragInTime) option. Consider that [dragToMove](#opt-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](#opt-dragBetweenResources) option. Consider that [dragToMove](#opt-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` ### dragTimeStepBase "viewStart" | "dayStart" Specifies the base of the [dragTimeStep](#opt-dragTimeStep) calculation. If set to `'viewStart'` it takes the `startTime` property of the [view](#opt-view) option as reference. **Default value**: `'dayStart'` ### 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](#opt-newEventText) option. Using the [extendDefaultEvent](#opt-extendDefaultEvent) option extra properties can be set for the created event. The event deletion functionality can be overwritten using the [eventDelete](#opt-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](#opt-clickToCreate) and [dragToCreate](#opt-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](#type-MbscCalendarEvent), event2: [MbscCalendarEvent](#type-MbscCalendarEvent)) => number Determines the ordering of the events within the same day. Can be a function that accepts two event objects as arguments and should return -1 or 1. If not specified, the default order is: - all day events - rest of events, sorted by start time; events with identical start times, will be ordered alphabetically based on their title **Default value**: `undefined` ### 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) => void | [MbscCalendarEvent](#type-MbscCalendarEvent) Use this option to set properties to the new event created with click or drag. The event creation is handled by the [clickToCreate](#opt-clickToCreate) and [dragToCreate](#opt-dragToCreate) options. It takes a function that should return the properties for the new event. The argument object passed to this function has the following properties: - `start`: *Date* - The date when the newly created event will start. - `resource`: *string | number* - The id of the resource where the event creation started. ```js extendDefaultEvent: (args) => { return { color: args.resource === 'admin' ? 'green' : 'red', title: 'My event', }; } ``` **Default value**: `undefined` ### 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](#opt-data) by date or by [resource](#opt-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](#type-MbscDateType)> | Array<[MbscCalendarInvalid](#type-MbscCalendarInvalid)> 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* - 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* - Specifies the [resource](#opt-resources) 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](#opt-slots) 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. ::: :::info For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December. ::: ```js [ // 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` The [`MbscCalendarInvalid`](#type-MbscCalendarInvalid) type has the following properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### invalidateEvent "start-end" | "strict" Specifies how to validate events against [invalid](#opt-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'` ### max [MbscDateType](#type-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](#opt-invalid) option with daily recurrence starting from the specific date. **Default value**: `undefined` ### min [MbscDateType](#type-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](#opt-invalid) option with daily recurrence until the specific date. **Default value**: `undefined` ### modules Array Additional modules can be added to the eventcalendar. The option receives an array of module objects. For example, the print module can be added through this option. ```js // import the print module import { print } from '@mobiscroll/print'; // later on, add it to the modules array: modules: [print] ``` ### refDate [MbscDateType](#type-MbscDateType) Specifies the reference date for the view calculation, when multiple days, weeks, months or years are displayed. If not specified, will be today's date. It denotes the reference point when calculating the pages going in the future and in the past. For example if the view type is day, the view size is 3, and the current date is `01/16/2024`, the pages are calculated from this date, so the initial page will contain `[01/16/2024, 01/16/2024, 01/17/2024]`, the next page `[01/18/2024, 01/19/2024, 01/20/2024]` and so on. In case of day view, the reference point will be exactly the specified date. For week, month and year views the reference point will be the start of the week, month or year of the specified day. Changing the reference date will not navigate the calendar to the specified date, it only recalculates the pages from the new reference date. To navigate the view to a specified date and time, use the [selectedDate](#opt-selectedDate) option. **Default value**: `undefined` ### resources null | Array<[MbscResource](#type-MbscResource)> The scheduler and timeline views can handle multiple resources. Resource grouping can be modified with the help of the [groupBy](#opt-groupBy) option. If set to `null` or `undefined`, all events will be displayed, regardless of their `resource` property. The timeline view will not display the resource column, if the resources option is not set. If set to an empty array, only those events will be displayed which are not tied to any resource. The timeline view will display an empty resource column when an empty array is passed. The timeline view can render multiple levels of hierarchy groups. Levels can be added with the help of the `children` property. The [`MbscResource`](#type-MbscResource) type has the following properties: - `background`: *string* - Specifies the background color of the resource row or column. - `children`: *Array<[MbscResource](#type-MbscResource)>* - Child resources. - `collapsed`: *boolean* - Specifies the displayed state of the child resource group. - `color`: *string* - Specifies the default event color 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. - `cssClass`: *string* - Specifies a css class for the resource row or column. - `eventCreation`: *boolean* - Disables event creation on specific resources by setting it to false. Defaults to true. - `eventDragBetweenResources`: *boolean* - Specifies whether the events in this resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the [dragBetweenResources](#opt-dragBetweenResources) option. - `eventDragBetweenSlots`: *boolean* - Specifies whether the events in this slot are movable across slots. Has precedence over the [dragBetweenSlots](#opt-dragBetweenSlots) option. - `eventDragInTime`: *boolean* - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventOverlap`: *boolean* - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize`: *boolean* - Specifies whether the events in this resource are resizable. Has precedence over the [dragToResize](#opt-dragToResize) option. - `fixed`: *boolean* - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-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 dra & rop and event creation functionalities to work properly. - `id`: *string | number* - The id of the resource. - `name`: *string* - Specifies the name of the resource. - `reorder`: *boolean* - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. ```js 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 [MbscResponsiveOptions](#type-MbscResponsiveOptions) 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, you can use multiple, but each must have a unique name 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](#type-MbscDateType) Specifies the selected date on the calendar. This can be changed programmatically and when changed the calendar will automatically navigate to the specified date. For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. This does not change the reference date that defines the reference point of the navigation pages. To change the reference point for the navigation (e.g. start the paging from the newly selected date) use the [refDate](#opt-refDate) option. You also need to pass a handler for the [onSelectedDateChange](#event-onSelectedDateChange) event to update the selected date when the date is changed from the calendar. **Default value**: `undefined` ### selectedEvents Array<[MbscCalendarEvent](#type-MbscCalendarEvent)> Specifies the selected events on the calendar. The [onSelectedEventsChange](#event-onSelectedEventsChange) event will be fired when the selected events change from the calendar. The [`MbscCalendarEvent`](#type-MbscCalendarEvent) type has the following properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. **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` ### showEventBuffer boolean If `true`, it will display the event buffers defined in the [event data](#opt-data). **Default value**: `true` ### showEventTooltip boolean If `false`, it will hide the native tooltip that shows up when hovering over an event. **Default value**: `true` ### 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](../theming/sass-variables) or [create custom themes](../theming/sass-themes). :::info Make sure that the theme you set is included in the downloaded package. ::: **Default value**: `undefined` ### themeVariant "light" | "dark" | "auto" Controls which variant of the [theme](#opt-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 [MbscTimezonePlugin](#type-MbscTimezonePlugin) 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](https://momentjs.com/timezone/) and [luxon](https://moment.github.io/luxon/#/). You can specify either the [dataTimezone](#opt-dataTimezone) or the [displayTimezone](#opt-displayTimezone) or both. Depending on which external library you use you can pass either the `momentTimezone`, `dayjsTimezone` or `luxonTimezone` objects. These objects can be imported from the mobiscroll bundle. **Default value**: `undefined` The [`MbscTimezonePlugin`](#type-MbscTimezonePlugin) type has the following properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* - ### width string | number Sets the width of the component. **Default value**: `undefined` ### Events The Scheduler ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code. ### @cell-click (args: MbscCellClickEvent, inst: EventcalendarBase) => void Triggered when a cell is clicked on the calendar view, scheduler grid, or timeline grid. 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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 view, scheduler grid, 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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 on a calendar day, scheduler cell, or timeline cell. Parameters: - args - The event argument with the following properties: - `colors`: *Array* - The colors for the hovered cell. - `date`: *Date* - The date of the hovered day. - `events`: *Array* - The events for the hovered cell. - `invalids`: *Array* - The invalid dates for the hovered cell. - `labels`: *Array* - If the cell has labels, contains the label objects for the hovered cell. - `marked`: *Array* - If the cell is marked, contains the marked objects for the hovered cell. - `selected`: *boolean* - Specifies if the cell is currently selected or not (in case of calendar view). - `target`: *HTMLElement* - The DOM element of the cell. - `resource`: *MbscResource* - The resource object for the hovered cell. - inst - The component instance. ### @cell-hover-out (args: MbscCellHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer leaves a calendar day, scheduler cell, or timeline cell. Parameters: - args - The event argument with the following properties: - `colors`: *Array* - The colors for the hovered cell. - `date`: *Date* - The date of the hovered cell. - `events`: *Array* - The events for the hovered cell. - `invalids`: *Array* - The invalid dates for the hovered cell. - `labels`: *Array* - If the cell has labels, contains the label objects for the hovered cell. - `marked`: *Array* - If the cell is marked, contains the marked objects for the hovered cell. - `selected`: *boolean* - Specifies if the cell is currently selected or not (in case of calendar view). - `target`: *HTMLElement* - The DOM element of the cell. - `resource`: *MbscResource* - The resource object for the hovered cell. - inst - The component instance. ### @cell-right-click (args: MbscCellClickEvent, inst: EventcalendarBase) => void Triggered when a cell is right-clicked on the calendar view, scheduler grid, 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* - The events for the clicked date. - `resource`: *string | number* - The id of the resource where the cell was clicked, if [resources](#opt-resources) are set. - `selected`: *boolean* - Specifies if the day is currently selected or not (before it was clicked). - `source`: *'calendar' | 'scheduler' | '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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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. - `resourceObj`: *MbscResource* - The resource where the event is being created, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is being created, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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' | 'scheduler'* - 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' | 'scheduler'* - The view where the event was created. - `target`: *HTMLElement* - The DOM element of the created event. - `resourceObj`: *MbscResource* - The resource where the event is being created, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is being created, if [slots](#opt-slots) are set. - 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* - The events being deleted in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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* - The deleted events in case of multiple event selection. - `source`: *'agenda' | 'calendar' | 'timeline' | 'scheduler'* - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicker, if [slots](#opt-slots) are set. - `slotObj`: *MbscResource* - The resource where the event was clicker, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was dragged, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was dragged, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was dragged, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'scheduler' | '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/scheduler 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' | 'scheduler' | '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/scheduler 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' | 'scheduler' | '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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is dragged, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is dragged, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is dragged, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'scheduler' | '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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event is hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event is hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event is hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event is hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was hovered, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was hovered, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was hovered, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was hovered. - `target`: *HTMLElement* - The DOM element of the event. - 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. In case of the timeline view, this will be the first day of the event on the current view. - `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](#opt-resources) are set. - `resourceObj`: *MbscResource* - The resource where the event was clicked, if [resources](#opt-resources) are set. - `slot`: *string | number* - The id of the slot where the event was clicked, if [slots](#opt-slots) are set. - `slotObj`: *MbscSlot* - The slot where the event was clicked, if [slots](#opt-slots) are set. - `source`: *'agenda' | 'calendar' | 'scheduler' | 'timeline' | 'popover'* - The view where the event was clicked. - `target`: *HTMLElement* - The DOM element of the event. - 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* - The updated events. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) 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* - The original events before the update. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) 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. - `oldResource`: number | string - The id of the resource from which the event was dragged. - `oldResourceObj`: *MbscResource* - The resource from which the event was dragged. - `oldSlot`: number | string - The id of the slot from which the event was dragged. - `oldSlotObj`: *MbscSlot* - The slot from which the event was dragged. - `resource`: number | string - The id of the resource where the event was dropped. - `resourceObj`: *MbscResource* - The resource where the event was dropped. - `slot`: number | string - The id of the slot where the event was dropped. - `slotObj`: *MbscSlot* - The slot where the event was dropped. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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' | 'scheduler'* - 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* - The updated events. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) is enabled. - `oldEvent`: *MbscCalendarEvent* - The original event before the update. - `oldEvents`: *Array* - The original events before the update. It is set on recurring event delete, when [multiple event selection](#opt-selectMultipleEvents) is enabled. - `resourceObj`: *MbscResource* - The resource where the event is updated, if [resources](#opt-resources) are set. - `slotObj`: *MbscSlot* - The slot where the event is updated, if [slots](#opt-slots) are set. - `source`: *'calendar' | 'timeline' | 'scheduler'* - 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. ### @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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `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, as an exclusive end date, pointing to 00:00 of the next day. - `month`: *Date* - The first day of the visible month in case of month view. - inst - The component instance. ### @resource-click (args: MbscResourceClickEvent, inst: EventcalendarBase) => void Triggered when a resource cell is clicked on the scheduler or timeline. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the day on which the resource was clicked, when resources are grouped by day. - `domEvent`: *Event* - The DOM event of the click. - `resource`: *MbscResource* - The resource associated with the clicked cell. - `source`: *'scheduler' | 'timeline'* - The view where the cell was clicked. - `target`: *HTMLElement* - The DOM element of the clicked cell. - inst - The component instance. ### @resource-double-click (args: MbscResourceClickEvent, inst: EventcalendarBase) => void Triggered when a resource cell is double-clicked on the scheduler or timeline. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the day on which the resource was clicked, when resources are grouped by day. - `domEvent`: *Event* - The DOM event of the click. - `resource`: *MbscResource* - The resource associated with the clicked cell. - `source`: *'scheduler' | 'timeline'* - The view where the cell was clicked. - `target`: *HTMLElement* - The DOM element of the clicked cell. - inst - The component instance. ### @resource-hover-in (args: MbscResourceHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer hovers a resource cell on the timeline or scheduler view. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the hovered resource cell in case of group by date. - `resource`: *MbscResource* - The hovered resource. - `source`: *'scheduler' | 'timeline'* - The view where the resource cell was hovered. - `target`: *HTMLElement* - The DOM element of the resource cell. - inst - The component instance. ### @resource-hover-out (args: MbscResourceHoverEvent, inst: EventcalendarBase) => void Triggered when the mouse pointer leaves a resource cell on the timeline or scheduler view. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the hovered resource cell in case of group by date. - `resource`: *MbscResource* - The hovered resource. - `source`: *'scheduler' | 'timeline'* - The view where the resource cell was hovered. - `target`: *HTMLElement* - The DOM element of the resource cell. - inst - The component instance. ### @resource-right-click (args: MbscResourceClickEvent, inst: EventcalendarBase) => void Triggered when a resource cell is right-clicked on the scheduler or timeline. Parameters: - args - The event argument with the following properties: - `date`: *Date* - The date of the day on which the resource was clicked, when resources are grouped by day. - `domEvent`: *Event* - The DOM event of the click. - `resource`: *MbscResource* - The resource associated with the clicked cell. - `source`: *'scheduler' | 'timeline'* - The view where the cell was clicked. - `target`: *HTMLElement* - The DOM element of the clicked cell. - inst - The component instance. ### @selected-date-change (args: MbscSelectedDateChangeEvent, inst: EventcalendarBase) => void Triggered when the selected date is changed, e.g. by clicking on a day on a calendar view, or by using the navigation arrows. You can use this event in conjunction with the [selectedDate](#opt-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](#opt-selectMultipleEvents) is enabled. You can also select events programmatically using the [selectedEvents](#opt-selectedEvents) option. Parameters: - args - The event argument with the following properties: - `events`: *Array* - The selected events. - inst - The component instance. ### @virtual-loading (args: MbscVirtualLoadEvent, inst: EventcalendarBase) => void Triggered when a new virtual page is loaded. You can use this to load events and resources on demand while scrolling the timeline and scheduler grid. Parameters: - args - The event argument with the following properties: - `viewStart`: *Date* - The date where the virtual view starts. - `viewEnd`: *Date* - The date where the virtual view end. - `resourceStart`: *number|string* - The id of the resource where the virtual view starts. - `resourceEnd`: *number|string* - The id of the resource where the virtual view ends. - `timeStart`: *number* - The time in milliseconds where the virtual view starts on the scheduler view. - `timeEnd`: *number* - The time in milliseconds where the virtual view ends on the scheduler view. - `oldResourceStart`: *number|string* - The id of the resource where the previous virtual view started. - `oldResourceEnd`: *number|string* - The id of the resource where the previous virtual view ended. - `oldViewStart`: *Date* - The date where the previous virtual view started. - `oldViewEnd`: *Date*- The date where the previous virtual view ended. - `oldTimeStart`: *number* - The time in milliseconds where the previous virtual view started on the scheduler view. - `oldTimeEnd`: *number* - The time in milliseconds where the previous virtual view ended on the scheduler view. - inst - The component instance. ### Localization The Scheduler is fully localized. This covers date and time format, button copy, rtl and more. ### 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](#localization-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](#localization-dateFormat) option. **Default value**: `'D DDD MMM YYYY'` ### dayNames Array The list of long day names, starting from Sunday. **Default value**: `['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']` ### dayNamesMin Array The list of minimal day names, starting from Sunday. **Default value**: `['S', 'M', 'T', 'W', 'T', 'F', 'S']` ### dayNamesShort Array The list of abbreviated day names, starting from Sunday. **Default value**: `['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']` ### firstDay number Set the first day of the week: Sunday is 0, Monday is 1, etc. **Default value**: `0` ### locale [MbscLocale](#type-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](https://mobiscroll.com/docs/core-concepts/localization#language-modules). 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 The list of full month names. **Default value**: `['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']` ### monthNamesShort Array The list of abbreviated month names. **Default value**: `['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']` ### newEventText string Title for the newly created event with the [dragToCreate](#opt-dragToCreate) and the [clickToCreate](#opt-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'` ### 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'` ### 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'` ### Slots The display of the Scheduler can be customized with different slot functions. ### bufferAfter ```html ``` Customize the buffer area that is displayed at the end of the scheduler and timeline events. The buffer can be defined with the help of the `bufferAfter` property of the [event data](#opt-data). The template will receive an event object as data. 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. ### bufferBefore ```html ``` Customize the buffer area that is displayed at the start of the scheduler and timeline events. The buffer can be defined with the help of the `bufferBefore` property of the [event data](#opt-data). The template will receive an event object as data. 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. ### cell ```html ``` Customize the cells of the Eventcalendar in scheduler and timeline views. The template will receive an object as context, which can be used to display custom content in the cells. Keep the cell template simple, as it will be called and rendered **very frequently** during scroll and view changes. The object passed to the template contains the following properties: - `colors`: _Array_ - The list of colors for the current cell. - `date`: _Date_ – The current cell's date. - `events`: _Array_ - The list of events for the current cell. - `invalids`: _Array_ - The list of invalids for the current cell. - `resource`: _MbscResource_ – The resource object for the current cell. - `slot`: _MbscSlot_ - The slot object for the current cell. ### header ```html ``` Customize the header of the event calendar. You can use custom markup and the built in header components of the calendar. ### resource ```html ``` Customize how the resources are rendered on the scheduler and timeline views. The following properties are available: - `resource`: _MbscResource_ - The rendered resource. - `day`: _Date_ - The date on which the resource is rendered. Available when grouping by date in the scheduler view, or when vertical day resolution is used in the timeline view. ### schedulerDay ```html ``` Customize the date header of the scheduler view. If you are looking to customize only the day cells content and don't want to bother with the styling of the cells, use the [schedulerDayContent](#slot-schedulerDayContent) option. The following day specific details are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - 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. ### schedulerDayContent ```html ``` Customize the day cells content of the scheduler view. 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 [schedulerDay](#slot-schedulerDay) option. The following properties are available: - `date`: _Date_ - The date of the rendered day. - `events`: _Array_ - 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. ### schedulerEvent ```html ``` Customize the events that appear on the scheduler. 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 [schedulerEventContent](#slot-schedulerEventContent) 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. ### schedulerEventContent ```html ``` Customize the event content that appears on the scheduler. 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 [schedulerEvent](#slot-schedulerEvent) 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. ### Types ### MbscCalendarColor Interface Properties: - `allDay`: *boolean* - Specifies whether the date you want to color is all day or not. - `background`: *string* - Background color of the cell. It 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`: *string | object | Date* - Specifies a single date for the color - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the color - `highlight`: *string* - Highlight color of the day, can be any valid CSS color (`'red'`, `'#ff0000'`, `'rgb(255, 0, 0)'`, etc.). - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring days. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the color - `textColor`: *string* - A color applied on the text. - `title`: *string* - A title that will be displayed on the item. ### MbscCalendarEvent Interface Properties: - `allDay`: *boolean* - Specifies if the event is all day or not. - `bufferAfter`: *number* - Defines a buffer time in minutes that will be displayed after the end of the event. - `bufferBefore`: *number* - Defines a buffer time in minutes that will be displayed before the start of the event. - `cellCssClass`: *string* - CSS class for the day cell. Only applicable for the calendar view. - `color`: *string* - Background color of the event - `cssClass`: *string* - Specifies a custom CSS class that is applied to the event. Useful when customization is needed on the event level. For example: setting the width for specific events. - `date`: *string | object | Date* - Specifies a single date for the event - `dragBetweenResources`: *boolean* - Specifies whether the event is movable across resources. - `dragBetweenSlots`: *boolean* - Specifies whether the event is movable across across slots. - `dragInTime`: *boolean* - Specifies whether the event is movable in time. - `editable`: *boolean* - Specifies if an event is editable or not. If false, drag & drop and resize is not allowed. - `end`: *string | object | Date* - Specifies the end date/time of a date/time range for the event - `id`: *string | number* - A unique id for the event. If not specified, the event will get a generated id. - `order`: *number* - Specifies the order of the event in the array. Has precedence over the default ordering rules. - `overlap`: *boolean* - Specifies whether the event can be overlapped. Has precedence over the `eventOverlap` property of the resource and the [eventOverlap](#opt-eventOverlap) option. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence rule for handling recurring events. - `recurringException`: *string | object | Date | Array* - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - 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](#opt-dragToResize) option. - `resource`: *string | number | Array* - In case of the timeline and scheduler view of the Eventcalendar, specifies the [resource](#opt-resources) ids for the event. The event will be displayed only on the specified resource. If there is no resource defined, it will be displayed on every resource. - `slot`: *string | number* - In case of the timeline view of the Eventcalendar, specifies the [slot](#opt-slot) id for the event. The event will be displayed only on the specified slot. If there is no slot defined, it will be displayed on every slot. - `start`: *string | object | Date* - Specifies the start date/time of a date/time range for the event - `textColor`: *string* - A color applied on the text. - `timezone`: *string* - Timezone of the event - `title`: *string* - The title of the event. - `tooltip`: *string* - The tooltip text of the event. ### MbscCalendarInvalid Interface Properties: - `allDay`: *boolean* - If true the specified invalid will cover the whole day. - `end`: *[MbscDateType](#type-MbscDateType)* - Specifies the end of the invalid range. - `recurring`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Recurrence rule for recurring invalid ranges. - `recurringException`: *[MbscDateType](#type-MbscDateType) | Array<[MbscDateType](#type-MbscDateType)>* - Specifies recurring exceptions. Useful when specific dates need to be skipped from the rule. - `recurringExceptionRule`: *string | [MbscRecurrenceRule](#type-MbscRecurrenceRule)* - Specifies a recurrence exception rule. Useful when recurring dates need to be skipped from the rule. - `start`: *[MbscDateType](#type-MbscDateType)* - Specifies the start of the invalid range. ### MbscDateType string | Date | object ### MbscLocale Interface Properties: - `allDayText`: *string* - `amText`: *string* - `calendarSystem`: *MbscCalendarSystem* - `cancelText`: *string* - `clearText`: *string* - `closeText`: *string* - `dateFormat`: *string* - `dateFormatFull`: *string* - `dateFormatLong`: *string* - `dateText`: *string* - `dateWheelFormat`: *string* - `dayNames`: *Array* - `dayNamesMin`: *Array* - `dayNamesShort`: *Array* - `daySuffix`: *string* - `dayText`: *string* - `eventText`: *string* - `eventsText`: *string* - `filterEmptyText`: *string* - `filterPlaceholderText`: *string* - `firstDay`: *number* - `fromText`: *string* - `hourText`: *string* - `minuteText`: *string* - `monthNames`: *Array* - `monthNamesShort`: *Array* - `monthSuffix`: *string* - `monthText`: *string* - `moreEventsPluralText`: *string* - `moreEventsText`: *string* - `nextMonthText`: *string* - `nextYearText`: *string* - `noEventsText`: *string* - `nowText`: *string* - `pmText`: *string* - `prevMonthText`: *string* - `prevYearText`: *string* - `rangeEndHelp`: *string* - `rangeEndLabel`: *string* - `rangeStartHelp`: *string* - `rangeStartLabel`: *string* - `rtl`: *boolean* - `secondText`: *string* - `selectedPluralText`: *string* - `selectedText`: *string* - `setText`: *string* - `timeFormat`: *string* - `timeText`: *string* - `timeWheels`: *string* - `toText`: *string* - `todayText`: *string* - `weekText`: *string* - `yearSuffix`: *string* - `yearText`: *string* ### MbscRecurrenceRule Interface Properties: - `count`: *number* - `day`: *number | Array* - `from`: *[MbscDateType](#type-MbscDateType)* - `interval`: *number* - `month`: *number | Array* - `pos`: *number* - `repeat`: *"daily" | "weekly" | "monthly" | "yearly"* - `until`: *[MbscDateType](#type-MbscDateType)* - `weekDays`: *string* - `weekStart`: *string* ### MbscResource Interface Properties: - `background`: *string* - Specifies the background color of the resource row or column. - `children`: *Array<[MbscResource](#type-MbscResource)>* - Child resources. - `collapsed`: *boolean* - Specifies the displayed state of the child resource group. - `color`: *string* - Specifies the default event color 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. - `cssClass`: *string* - Specifies a css class for the resource row or column. - `eventCreation`: *boolean* - Disables event creation on specific resources by setting it to false. Defaults to true. - `eventDragBetweenResources`: *boolean* - Specifies whether the events in this resource are movable across resources. It applies for scheduler and timeline views. Has precedence over the [dragBetweenResources](#opt-dragBetweenResources) option. - `eventDragBetweenSlots`: *boolean* - Specifies whether the events in this slot are movable across slots. Has precedence over the [dragBetweenSlots](#opt-dragBetweenSlots) option. - `eventDragInTime`: *boolean* - Specifies whether the events in this resource are movable in time. Has precedence over the [dragInTime](#opt-dragInTime) option. - `eventOverlap`: *boolean* - Specifies whether the events in this resource can be overlapped. Has precedence over the [eventOverlap](#opt-eventOverlap) option. - `eventResize`: *boolean* - Specifies whether the events in this resource are resizable. Has precedence over the [dragToResize](#opt-dragToResize) option. - `fixed`: *boolean* - Specifies whether the resource is fixed to the top. It applies for timeline view if `resolutionVertical` in [view](#opt-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 dra & rop and event creation functionalities to work properly. - `id`: *string | number* - The id of the resource. - `name`: *string* - Specifies the name of the resource. - `reorder`: *boolean* - Specifies whether the resource can be dragged and reordered. It applies for timeline view if `resourceReorder` in [view](#opt-view) option is enabled. The `MbscResource` supports custom properties in the form: ``` [x:string]: any ``` ### MbscResponsiveOptions Interface The `MbscResponsiveOptions` supports custom properties in the form: ``` [key:string]: MbscEventcalendarOptions & {breakpoint?: number} ``` The keys are the names of the breakpoints, and the values are objects containing the options for the given breakpoint. The `breakpoint` property, when present, specifies the min-width in pixels. The options will take into effect from that width. :::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 ### MbscTimezonePlugin Interface Properties: - `createDate`: *(s: any, year: string | number | Date | MbscTimezonedDate, month: number, date: number, h: number, min: number, sec: number, ms: number) => MbscTimezonedDate* - `parse`: *(date: string | number, s: any) => MbscTimezonedDate* --- ## Setting the initial view By default the initial view of the calendar displays the current date. Depending on the view type, this might be the current day, week, month or year. For views, where time is also displayed, the view will be scrolled to the current time as well. To set the initial date of the event calendar use the [`selectedDate`](./api#opt-selectedDate) option to pass the date and the [`@selected-date-change`](./api#event-onSelectedDateChange) event to update the state when the date is changed from the calendar, e.g. using the navigation arrows. ```html ``` For views, where time is also displayed, the view will be scrolled to the specified time. If the time part is not explicitly specified, it defaults to the start of the day. When multiple days, weeks, months or years are displayed, the position of the specified date on the view (first, second, third, etc. day/week/month/year) is determined by the [`refDate`](./api#opt-refDate) option. --- ## Templating ## Overview You can customize many parts of the Eventcalendar by writing custom templates. In Vue terms these templates are called named slots. You will find a comprehensive list of all the named slots available for the Eventcalendar in the [API slots](api#slots) section. ## Event templating When you want to customize how the events look, depending on what your goal is, you have two options: 1. [Customize the event content](#event-content-templating) - Mobiscroll takes care of rendering the events in the correct order and also prints basic fields, like `start`/`end`, whether it is an `allDay` event or not and also takes care of coloring the event appropriately. Everything else comes from the custom template. 2. [Customize the full event](#full-event-templating) - Mobiscroll takes care of rendering the events in the correct order, but everything else comes from the template you write. To define a template, create a `