syncfusion-react-scheduler
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSyncfusion React Scheduler
Syncfusion React Scheduler
The Syncfusion React Scheduler is a comprehensive event calendar component for displaying and managing appointments across multiple views (Day, Week, Month, Timeline, Agenda, Year). It supports drag-and-drop, resize, recurring events, resource grouping, timezone handling, and extensive customization options for building booking systems, schedule managers, and time-tracking applications.
Syncfusion React Scheduler是一款功能全面的事件日历组件,可在多种视图(日视图、周视图、月视图、时间线视图、议程视图、年视图)下显示和管理预约。它支持拖拽、调整大小、重复事件、资源分组、时区处理以及丰富的自定义选项,适用于构建预订系统、日程管理器和时间跟踪应用。
When to Use This Skill
何时使用该组件
Use this skill when you need to:
- Build calendar/scheduling applications - Event management, booking systems, appointment schedulers
- Display time-based events - Conferences, meetings, tasks, deadlines across various time intervals
- Manage appointments with CRUD operations - Create, read, update, delete events through UI or programmatically
- Handle recurring events - Daily, weekly, monthly, yearly patterns with exception dates
- Implement resource scheduling - Assign events to multiple resources (rooms, staff, equipment) with grouping
- Support multiple views - Day, Week, Work Week, Month, Year, Agenda, Timeline variations
- Enable drag-drop scheduling - Intuitive event creation, rescheduling, and time adjustment
- Work with timezones - Display events in different timezones for global scheduling
- Customize event display - Templates for events, cells, editor, tooltips, and styling
- Export/print schedules - Excel export, ICS calendar format, print functionality
- Implement accessibility - WCAG-compliant keyboard navigation and screen reader support
在以下场景中可使用该组件:
- 构建日历/日程应用 - 事件管理、预订系统、预约调度器
- 显示基于时间的事件 - 跨不同时间区间的会议、研讨会、任务、截止日期
- 通过CRUD操作管理预约 - 通过UI或编程方式创建、读取、更新、删除事件
- 处理重复事件 - 每日、每周、每月、每年的重复模式,支持例外日期
- 实现资源调度 - 将事件分配给多个资源(会议室、员工、设备)并进行分组
- 支持多种视图 - 日视图、周视图、工作周视图、月视图、年视图、议程视图、各类时间线视图
- 启用拖拽式日程安排 - 直观的事件创建、重新调度和时间调整
- 时区适配 - 为全球日程显示不同时区的事件
- 自定义事件显示 - 事件、单元格、编辑器、提示框的模板及样式定制
- 导出/打印日程 - Excel导出、ICS日历格式导出、打印功能
- 无障碍访问实现 - 符合WCAG标准的键盘导航和屏幕阅读器支持
Component Overview
组件概述
The Scheduler component renders a calendar interface with configurable views, appointment management, and rich interaction capabilities. It handles local and remote data sources, supports hierarchical resource grouping, provides customizable event editors, and includes performance optimizations like virtual scrolling for large datasets.
Key Capabilities:
- 12+ built-in view types (calendar and timeline orientations)
- Full CRUD operations with drag-drop and resize
- Recurrence patterns with RRULE support
- Multi-level resource grouping with color coding
- Timezone conversion and localization
- Template-based customization for all UI elements
- RESTful data binding with DataManager
- State persistence and export functionality
Scheduler组件可渲染带有可配置视图、预约管理和丰富交互功能的日历界面。它支持本地和远程数据源,支持分层资源分组,提供可自定义的事件编辑器,并针对大型数据集进行了虚拟滚动等性能优化。
核心功能:
- 12种以上内置视图类型(日历和时间线两种布局方向)
- 完整的CRUD操作,支持拖拽和调整大小
- 支持RRULE格式的重复规则
- 带颜色编码的多级资源分组
- 时区转换和本地化
- 所有UI元素的模板化自定义
- 基于DataManager的RESTful数据绑定
- 状态持久化和导出功能
Documentation and Navigation Guide
文档与导航指南
Getting Started
快速入门
📄 Read: references/getting-started.md
- Installation and package dependencies
- Basic Scheduler setup with required modules
- CSS theme imports and configuration
- View injection (Day, Week, Month, Agenda, Timeline)
- Initial render with sample appointments
- Data source binding basics
📄 阅读: references/getting-started.md
- 安装和包依赖
- 基础Scheduler配置与必要模块
- CSS主题导入与配置
- 视图注入(日视图、周视图、月视图、议程视图、时间线视图)
- 示例预约数据的初始渲染
- 数据源绑定基础
Appointments and Events
预约与事件
📄 Read: references/appointments-and-events.md
- Normal events (single time period)
- Spanned events (multi-day appointments)
- All-day events
- Recurring events (daily, weekly, monthly, yearly patterns)
- CRUD operations (create, update, delete via editor or API)
- Event templates and rendering customization
- Drag-and-drop event rescheduling
- Resize events to adjust duration
- Quick popups for rapid event creation
📄 阅读: references/appointments-and-events.md
- 普通事件(单个时间段)
- 跨时段事件(多天预约)
- 全天事件
- 重复事件(每日、每周、每月、每年的重复模式)
- CRUD操作(通过编辑器或API创建、更新、删除)
- 事件模板与渲染自定义
- 拖拽式事件重新调度
- 调整事件时长
- 快速弹窗创建事件
Views and Navigation
视图与导航
📄 Read: references/views-and-navigation.md
- Day, Week, Work Week views
- Month and Year views
- Agenda view (list format)
- Timeline views (Day, Week, Month, Year)
- Switching between views programmatically
- Setting default/current view
- View-specific configurations
- Custom view intervals and settings
- Navigation between dates
📄 阅读: references/views-and-navigation.md
- 日视图、周视图、工作周视图
- 月视图和年视图
- 议程视图(列表格式)
- 时间线视图(日、周、月、年)
- 编程方式切换视图
- 设置默认/当前视图
- 视图专属配置
- 自定义视图区间和设置
- 日期导航
Data Binding
数据绑定
📄 Read: references/data-binding.md
- Local JSON data array binding
- Remote data with DataManager
- RESTful service integration
- OData and Web API adaptors
- Event field mapping
- Custom data structure handling
- Lazy loading for performance
- Data CRUD synchronization
📄 阅读: references/data-binding.md
- 本地JSON数据数组绑定
- 基于DataManager的远程数据绑定
- RESTful服务集成
- OData和Web API适配器
- 事件字段映射
- 自定义数据结构处理
- 懒加载优化性能
- 数据CRUD同步
Resources and Grouping
资源与分组
📄 Read: references/resources-and-grouping.md
- Resource fields configuration (idField, textField, colorField)
- Single and multiple resource assignment
- Hierarchical resource grouping (parent-child relationships)
- Grouping by resources (vertical columns)
- Grouping by dates (horizontal timeline)
- Resource color coding for visual distinction
- Custom work hours per resource
- Expandable/collapsible groups in timeline
- Multiple resource selection in event editor
📄 阅读: references/resources-and-grouping.md
- 资源字段配置(idField、textField、colorField)
- 单资源和多资源分配
- 分层资源分组(父子关系)
- 按资源分组(垂直列)
- 按日期分组(水平时间线)
- 资源颜色编码以区分视觉效果
- 按资源自定义工作时间
- 时间线中的可展开/折叠分组
- 事件编辑器中的多资源选择
Customization
自定义配置
📄 Read: references/customization.md
- Event editor template customization
- Cell template customization
- Event rendering templates
- Quick info popup templates
- Tooltip customization
- Adding custom fields to editor
- Custom validation rules
- Context menu customization
📄 阅读: references/customization.md
- 事件编辑器模板自定义
- 单元格模板自定义
- 事件渲染模板
- 快速信息弹窗模板
- 提示框自定义
- 为编辑器添加自定义字段
- 自定义验证规则
- 上下文菜单自定义
Time Configuration
时间配置
📄 Read: references/time-configuration.md
- Timescale intervals and slot configuration
- Major/minor slot customization
- Timezone support (single and multiple zones)
- Working days configuration (weekdays filter)
- Working hours (startHour, endHour)
- Calendar modes (Gregorian, Islamic)
- First day of week setting
- Time format (12-hour vs 24-hour)
- Date header format customization
📄 阅读: references/time-configuration.md
- 时间刻度区间和插槽配置
- 主次插槽自定义
- 时区支持(单时区和多时区)
- 工作日配置(工作日筛选)
- 工作时间(startHour、endHour)
- 日历模式(公历、伊斯兰历)
- 一周起始日设置
- 时间格式(12小时制/24小时制)
- 日期头部格式自定义
Recurrence Editor
重复事件编辑器
📄 Read: references/recurrence.md
- Standalone recurrence editor component
- Recurrence rules (RRULE format)
- Daily recurrence patterns
- Weekly recurrence with day selection
- Monthly recurrence (by date or day)
- Yearly recurrence patterns
- Exception dates handling
- Edit/delete options for recurring series
- Follow events (edit single occurrence vs series)
- Recurrence rule validation
📄 阅读: references/recurrence.md
- 独立的重复事件编辑器组件
- 重复规则(RRULE格式)
- 每日重复模式
- 带日期选择的每周重复
- 每月重复(按日期或星期几)
- 每年重复模式
- 例外日期处理
- 重复系列的编辑/删除选项
- 事件跟随(编辑单个实例 vs 整个系列)
- 重复规则验证
Header and Layout
头部与布局
📄 Read: references/header-and-layout.md
- Header bar customization (toolbar)
- Custom toolbar items and actions
- Header rows configuration
- Date range display customization
- Component dimensions (width, height)
- Row auto-height feature
- Responsive layout behavior
- Mobile-friendly rendering
- Cell height configuration
📄 阅读: references/header-and-layout.md
- 头部栏自定义(工具栏)
- 自定义工具栏项和操作
- 头部行配置
- 日期范围显示自定义
- 组件尺寸(宽度、高度)
- 行自动高度功能
- 响应式布局行为
- 移动端友好渲染
- 单元格高度配置
Styling and Theming
样式与主题
📄 Read: references/styling-and-theming.md
- Built-in themes (Material, Bootstrap, Tailwind, Fluent, etc.)
- CSS customization approaches
- Custom CSS classes for events
- Cell styling with cssClass
- Resource-based styling
- Theme Studio integration
- Event color customization
- Hover and selection states
📄 阅读: references/styling-and-theming.md
- 内置主题(Material、Bootstrap、Tailwind、Fluent等)
- CSS自定义方法
- 事件的自定义CSS类
- 单元格样式(cssClass)
- 基于资源的样式
- 主题工作室集成
- 事件颜色自定义
- 悬停和选中状态
Accessibility and Localization
无障碍访问与本地化
📄 Read: references/accessibility-and-localization.md
- WCAG 2.0 AA compliance
- Keyboard navigation shortcuts
- ARIA attributes and roles
- Screen reader support
- Focus management
- High contrast themes
- Localization setup (i18n)
- RTL (right-to-left) support
- Date and time format localization
- Custom locale strings and translations
📄 阅读: references/accessibility-and-localization.md
- 符合WCAG 2.0 AA标准
- 键盘导航快捷键
- ARIA属性和角色
- 屏幕阅读器支持
- 焦点管理
- 高对比度主题
- 本地化设置(i18n)
- RTL(从右到左)支持
- 日期和时间格式本地化
- 自定义区域字符串和翻译
Advanced Features
高级功能
📄 Read: references/advanced-features.md
- State persistence (localStorage/sessionStorage)
- Export to Excel (appointments data)
- Export to ICS (calendar format)
- Print functionality with custom styles
- Clipboard operations (cut, copy, paste events)
- Virtual scrolling for performance
- Read-only mode
- Event validation rules
- Custom context menu integration
- Inline editing capabilities
📄 阅读: references/advanced-features.md
- 状态持久化(localStorage/sessionStorage)
- 导出到Excel(预约数据)
- 导出到ICS(日历格式)
- 带自定义样式的打印功能
- 剪贴板操作(剪切、复制、粘贴事件)
- 虚拟滚动优化性能
- 只读模式
- 事件验证规则
- 自定义上下文菜单集成
- 内联编辑功能
Quick Start
快速开始
tsx
import * as React from 'react';
import {
ScheduleComponent,
Day,
Week,
WorkWeek,
Month,
Agenda,
Inject,
EventSettingsModel
} from '@syncfusion/ej2-react-schedule';
// Sample appointment data
const appointments: object[] = [
{
Id: 1,
Subject: 'Team Meeting',
StartTime: new Date(2026, 2, 25, 9, 0),
EndTime: new Date(2026, 2, 25, 10, 30),
Location: 'Conference Room A'
},
{
Id: 2,
Subject: 'Project Review',
StartTime: new Date(2026, 2, 26, 14, 0),
EndTime: new Date(2026, 2, 26, 16, 0),
IsAllDay: false
}
];
const App = () => {
const eventSettings: EventSettingsModel = { dataSource: appointments };
return (
<ScheduleComponent
height="550px"
selectedDate={new Date(2026, 2, 25)}
eventSettings={eventSettings}
>
<Inject services={[Day, Week, WorkWeek, Month, Agenda]} />
</ScheduleComponent>
);
};
export default App;tsx
import * as React from 'react';
import {
ScheduleComponent,
Day,
Week,
WorkWeek,
Month,
Agenda,
Inject,
EventSettingsModel
} from '@syncfusion/ej2-react-schedule';
// 示例预约数据
const appointments: object[] = [
{
Id: 1,
Subject: '团队会议',
StartTime: new Date(2026, 2, 25, 9, 0),
EndTime: new Date(2026, 2, 25, 10, 30),
Location: '会议室A'
},
{
Id: 2,
Subject: '项目评审',
StartTime: new Date(2026, 2, 26, 14, 0),
EndTime: new Date(2026, 2, 26, 16, 0),
IsAllDay: false
}
];
const App = () => {
const eventSettings: EventSettingsModel = { dataSource: appointments };
return (
<ScheduleComponent
height="550px"
selectedDate={new Date(2026, 2, 25)}
eventSettings={eventSettings}
>
<Inject services={[Day, Week, WorkWeek, Month, Agenda]} />
</ScheduleComponent>
);
};
export default App;Common Patterns
常见模式
Pattern 1: Resource Scheduling (Multi-Resource Assignment)
模式1:多资源分配的资源调度
tsx
import { ScheduleComponent, ResourcesDirective, ResourceDirective, Inject, Day, Week, Month } from '@syncfusion/ej2-react-schedule';
const resources = [
{ text: 'Room A', id: 1, color: '#1aaa55' },
{ text: 'Room B', id: 2, color: '#357cd2' },
{ text: 'Room C', id: 3, color: '#e8115b' }
];
const appointments = [
{
Id: 1,
Subject: 'Conference',
StartTime: new Date(2026, 2, 25, 10, 0),
EndTime: new Date(2026, 2, 25, 12, 0),
RoomId: 1 // Maps to resource
}
];
const App = () => (
<ScheduleComponent
eventSettings={{ dataSource: appointments }}
group={{ resources: ['Rooms'] }}
>
<ResourcesDirective>
<ResourceDirective
field="RoomId"
title="Room"
name="Rooms"
dataSource={resources}
textField="text"
idField="id"
colorField="color"
/>
</ResourcesDirective>
<Inject services={[Day, Week, Month]} />
</ScheduleComponent>
);tsx
import { ScheduleComponent, ResourcesDirective, ResourceDirective, Inject, Day, Week, Month } from '@syncfusion/ej2-react-schedule';
const resources = [
{ text: '会议室A', id: 1, color: '#1aaa55' },
{ text: '会议室B', id: 2, color: '#357cd2' },
{ text: '会议室C', id: 3, color: '#e8115b' }
];
const appointments = [
{
Id: 1,
Subject: '研讨会',
StartTime: new Date(2026, 2, 25, 10, 0),
EndTime: new Date(2026, 2, 25, 12, 0),
RoomId: 1 // 关联资源
}
];
const App = () => (
<ScheduleComponent
eventSettings={{ dataSource: appointments }}
group={{ resources: ['Rooms'] }}
>
<ResourcesDirective>
<ResourceDirective
field="RoomId"
title="会议室"
name="Rooms"
dataSource={resources}
textField="text"
idField="id"
colorField="color"
/>
</ResourcesDirective>
<Inject services={[Day, Week, Month]} />
</ScheduleComponent>
);Pattern 2: Recurring Events with RRULE
模式2:基于RRULE的重复事件
tsx
const recurringEvent = {
Id: 1,
Subject: 'Weekly Standup',
StartTime: new Date(2026, 2, 24, 9, 0),
EndTime: new Date(2026, 2, 24, 9, 30),
RecurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,WE,FR;INTERVAL=1;COUNT=10'
// Occurs every Monday, Wednesday, Friday for 10 occurrences
};tsx
const recurringEvent = {
Id: 1,
Subject: '每周站会',
StartTime: new Date(2026, 2, 24, 9, 0),
EndTime: new Date(2026, 2, 24, 9, 30),
RecurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,WE,FR;INTERVAL=1;COUNT=10'
// 每周一、周三、周五重复,共10次
};Pattern 3: Remote Data Binding
模式3:远程数据绑定
tsx
import { DataManager, WebApiAdaptor } from '@syncfusion/ej2-data';
const dataManager = new DataManager({
url: 'https://api.example.com/appointments',
adaptor: new WebApiAdaptor(),
crossDomain: true
});
const eventSettings: EventSettingsModel = {
dataSource: dataManager
};
// Maps response fields to Scheduler fields
const fieldsMapping = {
id: 'AppointmentId',
subject: { name: 'Title' },
startTime: { name: 'Start' },
endTime: { name: 'End' },
description: { name: 'Notes' }
};tsx
import { DataManager, WebApiAdaptor } from '@syncfusion/ej2-data';
const dataManager = new DataManager({
url: 'https://api.example.com/appointments',
adaptor: new WebApiAdaptor(),
crossDomain: true
});
const eventSettings: EventSettingsModel = {
dataSource: dataManager
};
// 将响应字段映射到Scheduler字段
const fieldsMapping = {
id: 'AppointmentId',
subject: { name: 'Title' },
startTime: { name: 'Start' },
endTime: { name: 'End' },
description: { name: 'Notes' }
};Pattern 4: Custom Event Template
模式4:自定义事件模板
tsx
const eventTemplate = (props: any) => {
return (
<div className="template-wrap">
<div className="subject">{props.Subject}</div>
<div className="time">
{props.StartTime.toLocaleTimeString()} - {props.EndTime.toLocaleTimeString()}
</div>
{props.Location && <div className="location">📍 {props.Location}</div>}
</div>
);
};
<ScheduleComponent eventSettings={{ dataSource: data, template: eventTemplate }}>
{/* ... */}
</ScheduleComponent>tsx
const eventTemplate = (props: any) => {
return (
<div className="template-wrap">
<div className="subject">{props.Subject}</div>
<div className="time">
{props.StartTime.toLocaleTimeString()} - {props.EndTime.toLocaleTimeString()}
</div>
{props.Location && <div className="location">📍 {props.Location}</div>}
</div>
);
};
<ScheduleComponent eventSettings={{ dataSource: data, template: eventTemplate }}>
{/* ... */}
</ScheduleComponent>Key Props and Configuration
核心属性与配置
Essential Props
必备属性
| Prop | Type | Description |
|---|---|---|
| EventSettingsModel | Data source, field mappings, templates for appointments |
| Date | Currently displayed date in the scheduler |
| View | Active view (Day/Week/Month/Agenda/Timeline) |
| View[] | Available views to display in header |
| GroupModel | Resource grouping configuration |
| ResourcesModel[] | Resource data for scheduling |
| string | Scheduler timezone (e.g., 'America/New_York') |
| string | Work day start time (e.g., '08:00') |
| string | Work day end time (e.g., '18:00') |
| number[] | Working weekdays (0=Sunday, 6=Saturday) |
| TimeScaleModel | Timescale interval and slot configuration |
| boolean | Disable all editing operations |
| string/number | Component height |
| string/number | Component width |
| 属性 | 类型 | 描述 |
|---|---|---|
| EventSettingsModel | 预约的数据源、字段映射、模板配置 |
| Date | 调度器中当前显示的日期 |
| View | 激活的视图(日/周/月/议程/时间线) |
| View[] | 头部显示的可用视图 |
| GroupModel | 资源分组配置 |
| ResourcesModel[] | 调度所用的资源数据 |
| string | 调度器时区(例如:'America/New_York') |
| string | 工作日开始时间(例如:'08:00') |
| string | 工作日结束时间(例如:'18:00') |
| number[] | 工作日(0=周日,6=周六) |
| TimeScaleModel | 时间刻度区间和插槽配置 |
| boolean | 禁用所有编辑操作 |
| string/number | 组件高度 |
| string/number | 组件宽度 |
Important Methods
重要方法
| Method | Description |
|---|---|
| Programmatically add single or multiple appointments |
| Update existing appointment |
| Remove appointment by ID or object |
| Retrieve appointments within date range |
| Get all occurrences of recurring event |
| Open event editor programmatically |
| Close event editor |
| Re-render scheduler |
| 方法 | 描述 |
|---|---|
| 以编程方式添加单个或多个预约 |
| 更新现有预约 |
| 通过ID或对象删除预约 |
| 获取指定日期范围内的预约 |
| 获取重复事件的所有实例 |
| 以编程方式打开事件编辑器 |
| 关闭事件编辑器 |
| 重新渲染调度器 |
Key Events
关键事件
| Event | Description |
|---|---|
| Fired before any scheduler action (create/update/delete) |
| Fired after action completes |
| Fired on action failure |
| Fired when event is clicked |
| Fired when cell is clicked |
| Fired when cell is double-clicked (opens editor) |
| Fired when drag operation starts |
| Fired when drag operation completes |
| Fired when resize starts |
| Fired when resize completes |
| Fired before popup/editor opens |
| Fired before popup/editor closes |
| 事件 | 描述 |
|---|---|
| 调度器操作(创建/更新/删除)触发前执行 |
| 操作完成后执行 |
| 操作失败时执行 |
| 点击事件时触发 |
| 点击单元格时触发 |
| 双击单元格时触发(打开编辑器) |
| 拖拽操作开始时触发 |
| 拖拽操作完成时触发 |
| 调整大小操作开始时触发 |
| 调整大小操作完成时触发 |
| 弹窗/编辑器打开前触发 |
| 弹窗/编辑器关闭前触发 |
Common Use Cases
常见用例
- Meeting Room Scheduler - Resource-based scheduling with room availability and conflict prevention
- Doctor Appointment System - Patient booking with recurring appointments and timezone support
- Project Timeline Manager - Task scheduling with dependencies and milestone tracking
- Employee Shift Planner - Staff scheduling with multiple resources and custom work hours
- Event Management System - Conference scheduling with session tracking and agenda views
- Classroom Booking - Educational scheduling with recurring class patterns
- Service Booking Platform - Appointment scheduling with service provider resources
- Court/Facility Reservation - Resource scheduling with time slot management
- Maintenance Scheduler - Equipment maintenance tracking with recurring tasks
- Conference Room Calendar - Shared resource scheduling with availability visualization
- 会议室调度器 - 基于资源的调度,包含会议室可用性和冲突预防
- 医生预约系统 - 患者预约,支持重复事件和时区适配
- 项目时间线管理器 - 任务调度,包含依赖关系和里程碑跟踪
- 员工排班系统 - 多资源的员工调度,支持自定义工作时间
- 事件管理系统 - 会议调度,包含场次跟踪和议程视图
- 教室预订系统 - 教育场景调度,支持重复课程模式
- 服务预订平台 - 基于服务提供者资源的预约调度
- 场馆/设施预订 - 资源调度,包含时间段管理
- 维护调度器 - 设备维护跟踪,支持重复任务
- 共享会议室日历 - 共享资源调度,包含可用性可视化