The scheduler features vertically scrollable daily and weekly views.
The three views - scheduler, calendar, agenda - can be combined to create the perfect user experience on mobile, desktop and everything in-between.
The capabilities like recurring events, all-day, multi-day events, responsiveness are supported by all three views.
As part of Event calendar and scheduler it can be picked up with the Framework and Complete licenses or with the component license.
Scheduler - Mobile daily schedule
View daily schedules with a fixed week view at the top and a scrollable schedule for the day. The week view is optional and can be turned off.
All-day events are fixed at the top below the header and calendar.
The dates can be quickly navigated by clicking on the month & year indicator.
Scheduler - Desktop daily schedule
Daily schedules can be displayed on large screens as well as small screens.
All-day events are fixed at the top below the header and calendar, while the schedule view is scrollable.
The dates can be quickly navigated by clicking on the month & year indicator.
Scheduler - Mobile weekly schedule
A full week can be rendered on small screens if needed. The header with the days of the week fixed at the top while the schedule is scrollable.
The screen can easily become crowded so it might be a good idea to think in a responsive implementation - daily schedule on small screens and weekly schedule on bigger screens.
Scheduler - Desktop weekly schedule
Render a full weeks worth of schedule on the screen. The header with days of the week remains planted at the top while the grid with the hours of the week and scheduled events is scrollable.
The current hour is displayed so that upcoming events can be spotted easily.
Scheduler - Responsive behavior
The scheduler is fully responsive, it adapts to the available space and fills the screen to look good everywhere.
Use the responsive
option to configure how the scheduler behaves on different sized screens. You can set it up as a daily schedule view on small screens and a weekly schedule on bigger screens.
The responsive
option is equipped with five breakpoints - xsmall
, small
, medium
, large
, xlarge
- and custom values can be added for a perfect fine-tune.
Scheduler - Show/hide all-day events
Hide the all-day events section of the scheduler by setting the allDay
property under the view.scheduler
option.
Scheduler - Switching views
Dynamically switch views within one instance. Use a UI control to let users do the switching or do it programatically.
The example features a month view with with events as labels, a weekly schedule view, a daily schedule and a weekly agenda.
Use the setOptions
method to dynamically change the settings.
Scheduler - Event customization
Above the built in rendering mode you can either customize the full event or just the content of the event. If we break up the event into pieces there are four fields that we are interested in:
- The event
start
andend
time - Whether it is an
allDay
event or not - The event
color
- The event
title
The scheduler takes care of positioning the event container and everything else is your responsability. You will have to place and provide styling to all event fields. Beside the ones mentioned above you'll be able to render other custom fields, like description
, location
, participants
... and add buttons, custom interactions.
Pass a custom rendering function to the renderScheduleEvent
option. All original event fields along with computed fields like isMultiDay
, lastDay
can be reached inside the function.
Scheduler - Work calendar
Customize the scheduler by not only disabling certain hours but hide them through setting the startTime
and endTime
properties of the view.scheduler
option. Quikcly set up a work calendar that goes from Monday though Friday with the startDay
and endDay
properties and renders the schedule from 8AM to 6PM.
You can easily add breaks - like a "Lunch break" - or disable times with the invalid
option.
Scheduler - Visible hours and days
Customize the visible days and hours though the schedule
object under the view
option. You can control the days to display (eg. Weekdays) and the visible time range (eg. 8AM to 6PM).
- Specify the first and last day - Use the
startDay
andendDay
properties - Set the visible time range - Use the
startTime
andendTime
properties
Scheduler - Move, resize & create
Drag & drop is a core feature of the event calendar and it is composed of four sub-features:
- Click to create events - double click to create events. This can be turned off or set to single click
- Drag to create events - tap/click to start creating an event and drag to the desired length
- Move events - grab an event and move it wherever needed
- Resize events - change the length of en event, grab it from either end and resize it
You have granular control over features through the
clickToCreate
, dragToCreate
, dragToMove
and dragToResize
options, which are false
by default.
Use the dragTimeStep
option (defaults to 15 minutes) to set the snap resolution of all drag actions.
Scheduler - Manage blocked out times
Entire days and time ranges can blocked out to manage event creation and editing more efficiently.
To disable specific times, ranges, days or recurring days and times you can pass an array to the invalid
option. A couple of examples:
- To disable weekends, use the recurring object -
recurring: { repeat: 'weekly', weekDays: 'SA,SU' }
- Lunch break between 12 PM and 1 PM with
title
-{ start: "12:00", end: "13:00", title: 'Lunch break', recurring: { repeat: 'weekly', weekDays: 'MO,TU,WE,TH,FR' }
When dragging events onto disabled days or time-slots, they will automatically be denied and onEventCreateFailed
/onEventUpdateFailed
events will be triggered, from which custom logic can be executed to show a toast or maybe a modal for data correction.
Scheduler - Prevent event overlap
Sometimes it is necessary to guarantee that events don't overlap - eg. when scheduling workorders, interacting with a work calendar.
Use the onEventCreate
and onEventUpdate
events to reject the updates, additions and let the user know about it.
These two lifecycle events run before the event is actually created or updated whenever someone interacts with the scheduler through drag & drop. For a complete list of lifecycle events take a look at this interactive exmaple.
Scheduler - Event properties
The event data structure for the scheduler is straightforward with a couple of base properties that the component understands and uses to render the UI. Besides the base properties you can add any custom property, like location, description ...
id
- A unique ID for the event. If not specified a unique id will be generatedtitle
- Defines the event text. This can be plaintext or HTMLcolor
- Defines the event colorstart
- Sets the start date and time for the event. It can be a js date object, ISO date string or moment.js object. Learn about date formatsend
- Sets the end date and time for the event. The same formats are supported as forstart
allDay
- Configures the event as a full-day eventrecurring
- Configures the recurring rules for the event. Learn about recurring events
Scheduler - Supported date formats
Understanding how to work with dates inside the scheduler is essential.
You can pass to the data
, marked
, colors
and labels
in four different formats.
The scheduler can work with Javascript date objects, ISO strings and Moment.js objects.
Scheduler - Understanding recurring events
Configure daily
, weekly
,monthly
and yearly
recurring events. On top of setting up recurrence, you can exclude specific and recurring days. This is especially useful in cases when a single occurence of an event is deleted or is moved to a different time.
You can pass the recurrence rule in the recurring
property of the event as an object or a string in RRULE
format. Learn about the event data structure and where to place the recurring rules.
Use the configurator to experiment, build strings and objects that you can grab and use.
Scheduler - Loading inline data
What is a scheduler without any events in it? To populate it with events all you have to do is pass the event array to the data
option.
In a real-world scenario you would probabaly load the events from a remote resource or event better, load them on demand. However the point of this example is to understand how easy it is to add events to the scheduler.
Scheduler - Events from remote API
The scheduler can be populated by passing an array to the data
option, that you can construct either inline or by getting it from a remote API. The important thing to remember is that events need to be in a format that the scheduler understands.
Scheduler - Loading events on demand
The scheduler supports remote and local data sources. Besides that, events can be populated on initialization or loaded on demand.
Getting the events in real time as the user navigates improves load performance and always serves the most recent data.
Use the onPageLoading
lifecycle event to load the data runtime. You can learn about lifecycle events and places where to drop logic to customize the experience.
Scheduler - Events from Google calendar
Data can be loaded from any number of places. The idea is to load the data and make sure to convert it into a format that the scheduler understands. You can use base fields and add custom fields that you can then render with the help of templates.
You can show events coming from google calendars. In this example you'll see how you can load events from a public calendar using the googleSDK
. Make sure to set your API key
and Client ID
, that you can get from here.
Scheduler - Add/edit/delete events
After looking at the different operations of event creation, edit/update and delete it all can be all put together in a choesive example.
Drag to create and click to create is enabled. Events can be created by dragging or with double click. As soon as the initial posion is confirmed, a temporary event is created and a custom edit dialog is shown for refinement. On cancel the temporary event will be removed and on confirmation the event will stay in the calendar.
Drag to resize and drag to move is enabled. Events can be reordered and resized. In addtion to that, clicking on the event will open a custom dialog that enables editing the various properties.
Delete can be implmented inside the edit dialog with a button. It's just a matter of removing it from the data object. If a dialog is not shown on click, focused events can be deleted with the backspace and delete keys.
Scheduler - Customizing the header
You can customize how the header of the scheduler looks and how the components are arranged. Besides that you can also add custom functionality, like a segmented control that lets people switch between scheduler and calendar.
Use the renderHeader
option for passing a custom header layout. There are predefined components - shorthands if you will - that can be used to assemble the header:
-
Navigation component -
<div mbsc-calendar-nav></div>
. Use the.md-header-filter-controls
CSS class for custom overrides. -
Today button -
<button mbsc-calendar-today></button>
. Use the.md-header-filter-today
CSS class for custom overrides. -
Previous month button -
<button mbsc-calendar-prev></button>
. Use the.md-header-filter-prev
CSS class for custom overrides. -
Next month button -
<button mbsc-calendar-next></button>
. Use the.md-header-filter-next
CSS class for custom overrides.
For changing the order the controls are laid out, you only need to set up the
renderHeader
.
This example sets a consistent order and layout across all themes and shows a custom control at the far right end.
For a custom order on a theme to theme basis, you will need to use a little CSS. Flex layout makes reordering easy. It's just a matter of setting the order in CSS. For material use the .mbsc-material
, for windows the .mbsc-windows
prefix and for iOS it is .mbsc-ios
class. Eg.:
.mbsc-material .md-header-filter-prev { order: 1; }
.mbsc-material .md-header-filter-next { order: 2; }
.mbsc-material .md-header-filter-controls { order: 3; }
.mbsc-material .md-header-filter-today { order: 4; }
Scheduler - Custom component in header
The header of the scheduler is a canvas and an opportunity for customization. You can add custom components and enable new interaction in context.
Such an example would be a custom filter block created with the help of a segmented control and placed between the standard UI components, which are:
-
Navigation component -
<div mbsc-calendar-nav></div>
. Use the.md-header-filter-controls
CSS class for custom overrides. -
Today button -
<button mbsc-calendar-today></button>
. Use the.md-header-filter-today
CSS class for custom overrides. -
Previous month button -
<button mbsc-calendar-prev></button>
. Use the.md-header-filter-prev
CSS class for custom overrides. -
Next month button -
<button mbsc-calendar-next></button>
. Use the.md-header-filter-next
CSS class for custom overrides.
For changing the order the controls are laid out, you only need to set up the
renderHeader
.
For a custom order on a theme to theme basis, you will need to use a little CSS. Flex layout makes reordering easy. It's just a matter of setting the order in CSS. For material use the .mbsc-material
, for windows the .mbsc-windows
prefix and for iOS it is .mbsc-ios
class. Eg.:
.mbsc-material .md-header-filter-prev { order: 1; }
.mbsc-material .md-header-filter-next { order: 2; }
.mbsc-material .md-header-filter-controls { order: 3; }
.mbsc-material .md-header-filter-today { order: 4; }
Scheduler - Theming capabilities
The look and feel of the scheduler can be deeply customized. There are four levels of customization:
- Base themes: Choose between iOS, Material and Windows.
- Light or dark: Every theme has a
light
anddark
variant. Setting thethemeVariant
to'auto'
will switch based on system settings. - Custom themes: Use the theme builder to customize the colors and make it match your brand.
- Custom CSS: If you need further customization, the sky is the limit with CSS overrides.
You can also see how every example looks by changing the theme from the header.
Scheduler - Calendar systems
The scheduler supports multiple calendar systems. You can control it with the calendarSystem
setting, and it supports the following options:
- Gregorian - it is included by default
- Jalali - it is the default system of the Persian calendar and is inlcuded within the Farsi language pack
- Hijri - it is included in the Arabic language pack
Scheduler - Lifecycle events
The scheduler ships with different hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code.
While users interact with the UI events like onEventClick
, onInit
, onSelectedDateChange
... will be triggered.
Scheduler - Localization
The components are fully localized. In case of the scheduler this covers date and time format, button copy, rtl and more. You can see how each example shows up by clicking on the small flag icon or checking the examples below.
Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.