Search results

ScheduleModel API in JavaScript (ES5) Schedule API control

Interface for a class Schedule

Properties

actionBegin

EmitType<ActionEventArgs>

Triggers on beginning of every scheduler action.

actionComplete

EmitType<ActionEventArgs>

Triggers on successful completion of the scheduler actions.

actionFailure

EmitType<ActionEventArgs>

Triggers when a scheduler action gets failed or interrupted and an error information will be returned.

cellClick

EmitType<CellClickEventArgs>

Triggers when the scheduler cells are single clicked or on single tap on the same cells in mobile devices.

cellDoubleClick

EmitType<CellClickEventArgs>

Triggers when the scheduler cells are double clicked.

created

EmitType<Object>

Triggers after the scheduler component is created.

dataBinding

EmitType<string>

Triggers before the data binds to the scheduler.

dataBound

EmitType<string>

Triggers once the event data is bound to the scheduler.

destroyed

EmitType<Object>

Triggers when the scheduler component is destroyed.

drag

EmitType<DragEventArgs>

Triggers when an appointment is being in a dragged state.

dragStart

EmitType<DragEventArgs>

Triggers when an appointment is started to drag.

dragStop

EmitType<DragEventArgs>

Triggers when the dragging of appointment is stopped.

eventClick

EmitType<EventClickArgs>

Triggers when the events are single clicked or on single tapping the events on the mobile devices.

eventRendered

EmitType<EventRenderedArgs>

Triggers before each of the event getting rendered on the scheduler user interface.

hover

EmitType<HoverEventArgs>

Triggers when the scheduler elements are hovered.

moreEventsClick

EmitType<MoreEventsClickArgs>

Triggers when the more events indicator are clicked.

Triggers before the date or view navigation takes place on scheduler.

popupClose

EmitType<PopupCloseEventArgs>

Triggers before any of the scheduler popups close on the page.

popupOpen

EmitType<PopupOpenEventArgs>

Triggers before any of the scheduler popups opens on the page.

renderCell

EmitType<RenderCellEventArgs>

Triggers before each element of the schedule rendering on the page.

resizeStart

EmitType<ResizeEventArgs>

Triggers when an appointment is started to resize.

resizeStop

EmitType<ResizeEventArgs>

Triggers when the resizing of appointment is stopped.

resizing

EmitType<ResizeEventArgs>

Triggers when an appointment is being in a resizing action.

select

EmitType<SelectEventArgs>

Triggers when multiple cells or events are selected on the Scheduler.

agendaDaysCount

number

Sets the number of days to be displayed by default in Agenda View and in case of virtual scrolling, the number of days will be fetched on each scroll-end based on this count.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  agendaDaysCount: 2
});
scheduleObj.appendTo("#Schedule");

allowDragAndDrop

boolean

When set to true, allows the appointments to move over the time slots. When an appointment is dragged, both its start and end time tends to change simultaneously allowing it to reschedule the appointment on some other time.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  allowDragAndDrop: false
});
scheduleObj.appendTo("#Schedule");

allowInline

boolean

This property helps user to add/edit the event in inline. By default, it is set to false.

allowKeyboardInteraction

boolean

When set to true, allows the keyboard interaction to take place on Schedule.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  allowKeyboardInteraction: false
});
scheduleObj.appendTo("#Schedule");

allowMultiCellSelection

boolean

This property helps user to allow/prevent the selection of multiple cells. By default, it is set to true.

allowMultiRowSelection

boolean

This property helps user to allow/prevent the selection of multiple days(rows). By default, it is set to true.

allowResizing

boolean

When set to true, allows the resizing of appointments. It allows the rescheduling of appointments either by changing the start or end time by dragging the event resize handlers.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  allowResizing: false
});
scheduleObj.appendTo("#Schedule");

calendarMode

string

It allows the Scheduler to display in other calendar modes. By default, Scheduler is displayed in Gregorian calendar mode.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  calendarMode: "Islamic"
});
scheduleObj.appendTo("#Schedule");

To change the mode, you can set either Gregorian or Islamic as a value to this calendarMode property.

cellHeaderTemplate

string

It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto the month date cells. This template is only applicable for month view day cells.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop,
  DragEventArgs
} from "@syncfusion/ej2-schedule";
import { Internationalization } from "@syncfusion/ej2-base";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let instance: Internationalization = new Internationalization();
(window as TemplateFunction).getDate = (date: Date) => {
  return instance.formatDate(date, { skeleton: "Ed" });
};
interface TemplateFunction extends Window {
    getDate?: Function;
}
let scheduleObj: Schedule = new Schedule({
  cellHeaderTemplate: '<div class="templatewrap">${getDate(data.date)}</div>'
});
scheduleObj.appendTo("#Schedule");

cellTemplate

string

The template option which is used to render the customized work cells on the Schedule. Here, the template accepts either the string or HTMLElement as template design and then the parsed design is displayed onto the work cells. The fields accessible via template are as follows.

  • date
  • groupIndex
  • type

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop,
  DragEventArgs
} from "@syncfusion/ej2-schedule";
import { Internationalization } from "@syncfusion/ej2-base";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let instance: Internationalization = new Internationalization();
(window as TemplateFunction).getMonthCellText = (date: Date) => {
  if (date.getMonth() === 10 && date.getDate() === 23) {
    return '<img src= "https://ej2.syncfusion.com/demos/src/schedule/images/birthday.svg" />';
  } else if (date.getMonth() === 11 && date.getDate() === 9) {
    return '<img src= "https://ej2.syncfusion.com/demos/src/schedule/images/get-together.svg" />';
  }
  return "";
};
(window as TemplateFunction).getWorkCellText = (date: Date) => {
  let weekEnds: number[] = [0, 6];
  if (weekEnds.indexOf(date.getDay()) >= 0) {
    return "<img src='https://ej2.syncfusion.com/demos/src/schedule/images/newyear.svg' />";
  }
  return "";
};

interface TemplateFunction extends Window {
  getWorkCellText?: Function;
  getMonthCellText?: Function;
}

let scheduleObj: Schedule = new Schedule({
  cellTemplate:
    '${if(type === "workCells")}<div class="templatewrap">${getWorkCellText(data.date)}</div>${/if}${if(type === "monthCells")}<div class="templatewrap">${getMonthCellText(data.date)}</div>${/if}'
});
scheduleObj.appendTo("#Schedule");

cssClass

string

It is used to customize the Schedule which accepts custom CSS class names that defines specific user-defined styles and themes to be applied on the Schedule element.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  cssClass: 'schedule-cell-dimension'
});
scheduleObj.appendTo("#Schedule");

currentView

string

To set the active view on scheduler, the currentView property can be used and it usually accepts either of the following available view options. The view option specified in this property will be initially loaded on the schedule.

  • Day
  • Week
  • WorkWeek
  • Month
  • Year
  • Agenda
  • MonthAgenda
  • TimelineDay
  • TimelineWeek
  • TimelineWorkWeek
  • TimelineMonth
  • TimelineYear

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  currentView:'Month'
});
scheduleObj.appendTo("#Schedule");

dateFormat

string

By default, Schedule follows the date-format as per the default culture assigned to it. It is also possible to manually set specific date format by using the dateFormat property.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  dateFormat:'dd-MMM-yyyy'
});
scheduleObj.appendTo("#Schedule");

The format of the date range label in the header bar depends on the dateFormat value or else based on the locale assigned to the Schedule.

dateHeaderTemplate

string

It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto the date header cells. The field that can be accessed via this template is date.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop
} from "@syncfusion/ej2-schedule";
import { Internationalization } from "@syncfusion/ej2-base";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let instance: Internationalization = new Internationalization();
(window as TemplateFunction).getDateHeaderText = (value: Date) => {
  return instance.formatDate(value, { skeleton: "Ed" });
};

interface TemplateFunction extends Window {
  getDateHeaderText?: Function;
}

let scheduleObj: Schedule = new Schedule({
  dateHeaderTemplate:
    '<div class="date-text">${getDateHeaderText(data.date)}</div>'
});
scheduleObj.appendTo("#Schedule");

editorTemplate

string

The template option to render the customized editor window. The form elements defined within this template should be accompanied with e-field class, so as to fetch and process it from internally.

    	<div id="Schedule"> </div>

		<script id="EventEditorTemplate" type="text/x-template">
			<table class="custom-event-editor" width="100%" cellpadding="5">
        <tbody>
            <tr>
                <td class="e-textlabel">Summary</td>
                <td colspan="4">
                    <input id="Subject" class="e-field e-input" type="text" value="" name="Subject" style="width: 100%" />
                </td>
            </tr>
            <tr>
                <td class="e-textlabel">Status</td>
                <td colspan="4">
                    <input type="text" id="EventType" name="EventType" class="e-field" style="width: 100%" />
                </td>
            </tr>
            <tr>
            <td class="e-textlabel">From</td>
                <td colspan="4">
                    <input id="StartTime" class="e-field" type="text" name="StartTime" />
                </td>
            </tr>
            <tr>
                <td class="e-textlabel">To</td>
                <td colspan="4">
                    <input id="EndTime" class="e-field" type="text" name="EndTime" />
                </td>
            </tr>
            <tr>
                <td class="e-textlabel">Reason</td>
                <td colspan="4">
                    <textarea id="Description" class="e-field e-input" name="Description" rows="3" cols="50"
                        style="width: 100%; height: 60px !important; resize: vertical"></textarea>
                </td>
            </tr>
        </tbody>
    </table>
</script>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop,
  PopupOpenEventArgs
} from "@syncfusion/ej2-schedule";
import { Internationalization } from "@syncfusion/ej2-base";
import { DateTimePicker } from "@syncfusion/ej2-calendars";
import { DropDownList } from "@syncfusion/ej2-dropdowns";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  editorTemplate: "#EventEditorTemplate",
  popupOpen: (args: PopupOpenEventArgs) => {
    if (args.type === "Editor") {
      let statusElement: HTMLInputElement = args.element.querySelector(
        "#EventType"
      ) as HTMLInputElement;
      if (!statusElement.classList.contains("e-dropdownlist")) {
        let dropDownListObject: DropDownList = new DropDownList({
          placeholder: "Choose status",
          value: statusElement.value,
          dataSource: ["New", "Requested", "Confirmed"]
        });
        dropDownListObject.appendTo(statusElement);
      }
      let startElement: HTMLInputElement = args.element.querySelector(
        "#StartTime"
      ) as HTMLInputElement;
      if (!startElement.classList.contains("e-datetimepicker")) {
        new DateTimePicker(
          { value: new Date(startElement.value) || new Date() },
          startElement
        );
      }
      let endElement: HTMLInputElement = args.element.querySelector(
        "#EndTime"
      ) as HTMLInputElement;
      if (!endElement.classList.contains("e-datetimepicker")) {
        new DateTimePicker(
          { value: new Date(endElement.value) || new Date() },
          endElement
        );
      }
    }
  }
});
scheduleObj.appendTo("#Schedule");

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads.

enableRecurrenceValidation

boolean

The recurrence validation will be done by default When this property is set to false, the recurrence validation will be skipped.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  enableRecurrenceValidation: false
});
scheduleObj.appendTo("#Schedule");

enableRtl

boolean

Enable or disable rendering component in right to left direction.

endHour

string

It is used to specify the end hour, at which the Schedule ends. It too accepts the time string in a short skeleton format.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  endHour: "18:00"
});
scheduleObj.appendTo("#Schedule");

eventDragArea

string

It enables the external drag and drop support for appointments on scheduler, to be able to move them out of the scheduler layout. When the drag area is explicitly set with specific DOM element name, the appointments can be dragged anywhere within the specified drag area location.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop, DragEventArgs } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  eventDragArea: "body"
});
scheduleObj.appendTo("#Schedule");

eventSettings

EventSettingsModel

Complete set of settings related to Schedule events to bind it to local or remote dataSource, map applicable database fields and other validation to be carried out on the available fields.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop,
  DragEventArgs
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let data: object[] = [
  {
    Subject: "Paris",
    StartTime: new Date(2018, 1, 15, 10, 0),
    EndTime: new Date(2018, 1, 15, 12, 30)
  }
];
let scheduleObj: Schedule = new Schedule({
  eventSettings: { dataSource: data }
});
scheduleObj.appendTo("#Schedule");

firstDayOfWeek

number

This option allows the user to set the first day of a week on Schedule. It should be based on the locale set to it and each culture defines its own first day of week values. If needed, the user can set it manually on his own by defining the value through this property. It usually accepts the integer values, whereby 0 is always denoted as Sunday, 1 as Monday and so on.

    <div id="Schedule"> </div>
import { Schedule, Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop } from '@syncfusion/ej2-schedule';

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  firstDayOfWeek: 2
});
scheduleObj.appendTo("#Schedule");

group

GroupModel

Allows defining the group related settings of multiple resources. When this property is non-empty, it means that the resources will be grouped on the schedule layout based on the provided resource names.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  group: {
    resources: ["Airlines"]
  },
  resources: [
    {
      field: "AirlineId",
      title: "Airline Name",
      name: "Airlines",
      allowMultiple: true,
      dataSource: [
        { AirlineName: "Airways 1", AirlineId: 1, AirlineColor: "#EA7A57" },
        { AirlineName: "Airways 2", AirlineId: 2, AirlineColor: "#357cd2" },
        { AirlineName: "Airways 3", AirlineId: 3, AirlineColor: "#7fa900" }
      ],
      textField: "AirlineName",
      idField: "AirlineId",
      colorField: "AirlineColor"
    }
  ]
});
scheduleObj.appendTo("#Schedule");

headerRows

HeaderRowsModel[]

Allows defining the collection of custom header rows to display the year, month, week, date and hour label as an individual row on the timeline view of the scheduler.

    <div id="Schedule"> </div>
import { Schedule, TimelineViews } from "@syncfusion/ej2-schedule";

Schedule.Inject(TimelineViews);

let scheduleObj: Schedule = new Schedule({
  headerRows: [
    { option: "Year" },
    { option: "Month" },
    { option: "Week" },
    { option: "Date" },
    { option: "Hour" }
  ],
  views: ["TimelineWeek"]
});
scheduleObj.appendTo("#Schedule");

height

string | number

Sets the height of the Schedule component, accepting both string and number values.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  height: "550px"
});
scheduleObj.appendTo("#Schedule");

The string type includes either pixel or percentage values. When height is set with specific pixel value, then the Schedule will be rendered to that specified space. In case, if auto value is set, then the height of the Schedule gets auto-adjusted within the given container.

hideEmptyAgendaDays

boolean

The days which does not has even a single event to display will be hidden from the UI of Agenda View by default. When this property is set to false, the empty dates will also be displayed on the Schedule.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  hideEmptyAgendaDays: false
});
scheduleObj.appendTo("#Schedule");

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

maxDate

Date

To define the maximum date on the Schedule, maxDate property can be defined. Usually, it defaults to the new Date(2099, 11, 31).

minDate

Date

To define the minimum date on the Schedule, minDate property can be defined. Usually, it defaults to the new Date(1900, 0, 1).

quickInfoOnSelectionEnd

boolean

This property helps to show quick popup after multiple cell selection. By default, it is set to false.

quickInfoTemplates

QuickInfoTemplatesModel

The template option to customize the quick window. The three sections of the quick popup whereas the header, content, and footer can be easily customized with individual template option.

    <div id="Schedule"> </div>

    <script id="headerTemplate" type="text/x-template">
        <div>
            ${if (elementType === 'cell')}
            <div class="e-cell-header">
                <div class="e-header-icon-wrapper">
                    <button class="e-close" title="Close"></button>
                </div>
            </div>
            ${else}
            <div class="e-event-header">
                <div class="e-header-icon-wrapper">
                    <button class="e-close" title="CLOSE"></button>
                </div>
            </div>
            ${/if}
        </div>
    </script>
    <script id="contentTemplate" type="text/x-template">
        <div>
            ${if (elementType === 'cell')}
            <div class="e-cell-content">
                <form class="e-schedule-form">
                    <div>
                        <input class="subject e-field" type="text" name="Subject" placeholder="Title">
                    </div>
                    <div>
                        <input class="location e-field" type="text" name="Location" placeholder="Location">
                    </div>
                </form>
            </div>
            ${else}
            <div class="e-event-content">
                <div class="e-subject-wrap">
                    ${if (Subject)}
                    <div class="subject">${Subject}</div>${/if} ${if (City)}
                    <div class="location">${City}</div>${/if} ${if (Description)}
                    <div class="description">${Description}</div>${/if}
                </div>
            </div>
            ${/if}
        </div>
    </script>
    <script id="footerTemplate" type="text/x-template">
        <div>
            ${if (elementType === 'cell')}
            <div class="e-cell-footer">
                <button class="e-event-details" title="Additional Details">Additional Details</button>
                <button class="e-event-create" title="Add">Add</button>
            </div>
            ${else}
            <div class="e-event-footer">
                <button class="e-event-edit" title="Edit">Edit</button>
                <button class="e-event-delete" title="Delete">Delete</button>
            </div>
            ${/if}
        </div>
    </script>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  quickInfoTemplates: {
    header: "#headerTemplate",
    content: "#contentTemplate",
    footer: "#footerTemplate"
  }
});
scheduleObj.appendTo("#Schedule");

readonly

boolean

When set to true, makes the Schedule to render in a read only mode. No CRUD actions will be allowed at this time.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  readonly: true
});
scheduleObj.appendTo("#Schedule");

resourceHeaderTemplate

string

Template option to customize the resource header bar. Here, the template accepts either the string or HTMLElement as template design and then the parsed design is displayed onto the resource header cells. The following can be accessible via template.

  • resource - All the resource fields.
  • resourceData - object collection of current resource.

    <div id="Schedule"> </div>
    
    <script id="resourceTemplate" type="text/x-template">
        <div class='template-wrap'>
            <div class="resource-details">
                <div class="resource-name">${resourceData.text}</div>
                <div class="resource-designation">${resourceData.designation}</div>
            </div>
        </div>
    </script>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  resourceHeaderTemplate: "#resourceTemplate",
  group: {
    resources: ["Airlines"]
  },
  resources: [
    {
      field: "AirlineId",
      title: "Airline Name",
      name: "Airlines",
      allowMultiple: true,
      dataSource: [
        { AirlineName: "Airways 1", AirlineId: 1, AirlineColor: "#EA7A57" },
        { AirlineName: "Airways 2", AirlineId: 2, AirlineColor: "#357cd2" },
        { AirlineName: "Airways 3", AirlineId: 3, AirlineColor: "#7fa900" }
      ],
      textField: "AirlineName",
      idField: "AirlineId",
      colorField: "AirlineColor"
    }
  ]
});
scheduleObj.appendTo("#Schedule");

resources

ResourcesModel[]

Allows defining the collection of resources to be displayed on the Schedule. The resource collection needs to be defined with unique resource names to identify it along with the respective dataSource and field mapping options.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  Resize,
  DragAndDrop
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop);

let scheduleObj: Schedule = new Schedule({
  group: {
    resources: ["Airlines"]
  },
  resources: [
    {
      field: "AirlineId",
      title: "Airline Name",
      name: "Airlines",
      allowMultiple: true,
      dataSource: [
        { AirlineName: "Airways 1", AirlineId: 1, AirlineColor: "#EA7A57" },
        { AirlineName: "Airways 2", AirlineId: 2, AirlineColor: "#357cd2" },
        { AirlineName: "Airways 3", AirlineId: 3, AirlineColor: "#7fa900" }
      ],
      textField: "AirlineName",
      idField: "AirlineId",
      colorField: "AirlineColor"
    }
  ]
});
scheduleObj.appendTo("#Schedule");

rowAutoHeight

boolean

when set to true, allows the height of the work-cells to adjust automatically based on the number of appointments present in those time ranges.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  rowAutoHeight: true
});
scheduleObj.appendTo("#Schedule");

selectedDate

Date

To mark the active (current) date on the Schedule, selectedDate property can be defined. Usually, it defaults to the current System date.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  selectedDate: new Date(2018, 3, 1)
});
scheduleObj.appendTo("#Schedule");

showHeaderBar

boolean

When set to false, hides the header bar of the Schedule from UI. By default, the header bar holds the date and view navigation options, to which the user can add their own custom items onto it.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  showHeaderBar: false
});
scheduleObj.appendTo("#Schedule");

showQuickInfo

boolean

When set to true, displays a quick popup with cell or event details on single clicking over the cells or on events. By default, it is set to true.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  showQuickInfo: false
});
scheduleObj.appendTo("#Schedule");

showTimeIndicator

boolean

When set to false, hides the current time indicator from the Schedule. Otherwise, it visually depicts the live current system time appropriately on the user interface.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  showTimeIndicator: false
});
scheduleObj.appendTo("#Schedule");

showWeekNumber

boolean

When set to true, displays the week number of the current view date range. By default, it is set to false.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  showWeekNumber: false
});
scheduleObj.appendTo("#Schedule");

showWeekend

boolean

When set to false, it hides the weekend days of a week from the Schedule. The days which are not defined in the working days collection are usually treated as weekend days.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  showWeekend: false
});
scheduleObj.appendTo("#Schedule");

Note: By default, this option is not applicable on Work Week view. For example, if the working days are defined as [1, 2, 3, 4], then the remaining days of that week will be considered as the weekend days and will be hidden on all the views.

startHour

string

It is used to specify the starting hour, from which the Schedule starts to display. It accepts the time string in a short skeleton format and also, hides the time beyond the specified start time.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  startHour: "10:00"
});
scheduleObj.appendTo("#Schedule");

timeScale

TimeScaleModel

Allows to set different time duration on Schedule along with the customized grid count. It also has template option to customize the time slots with required time values in its own format.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  timeScale: {
    enable: true,
    interval: 60,
    slotCount: 6
  }
});
scheduleObj.appendTo("#Schedule");

timezone

string

Schedule will be assigned with specific timezone, so as to display the events in it accordingly. By default, Schedule dates are processed with System timezone, as no timezone will be assigned specifically to the Schedule at the initial time. Whenever the Schedule is bound to remote data services, it is always recommended to set specific timezone to Schedule to make the events on it to display on the same time irrespective of the system timezone. It usually accepts the valid IANA timezone names.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  timezone: "UTC"
});
scheduleObj.appendTo("#Schedule");

views

string[] | ViewsModel[]

This property holds the views collection and its configurations. It accepts either the array of view names or the array of view objects that holds different configurations for each views. By default, Schedule displays all the views namely Day, Week, Work Week, Month and Agenda. Example for array of views:

Example for array of view objects:

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  views: ['Day', 'Week', 'WorkWeek', 'Month', 'Agenda'],
});
scheduleObj.appendTo("#Schedule");

width

string | number

Sets the width of the Schedule component, accepting both string and number values.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  width: '100%'
});
scheduleObj.appendTo("#Schedule");

The string value can be either pixel or percentage format. When set to auto, the Schedule width gets auto-adjusted and display its content related to the viewable screen size.

workDays

number[]

It is used to set the working days on Schedule. The only days that are defined in this collection will be rendered on the workWeek view whereas on other views, it will display all the usual days and simply highlights the working days with different shade.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  workDays: [1, 3, 5]
});
scheduleObj.appendTo("#Schedule");

workHours

WorkHoursModel

The working hours should be highlighted on Schedule with different color shade and an additional option must be provided to highlight it or not. This functionality is handled through workHours property and the start work hour should be 9 AM by default and end work hour should point to 6 PM. The start and end working hours needs to be provided as Time value of short skeleton type.

    <div id="Schedule"> </div>
import {
  Schedule,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda
} from "@syncfusion/ej2-schedule";

Schedule.Inject(Day, Week, WorkWeek, Month, Agenda);

let scheduleObj: Schedule = new Schedule({
  workHours: {
    highlight: true,
    start: "11:00",
    end: "20:00"
  }
});
scheduleObj.appendTo("#Schedule");