VSeed, an elegant data composer, transforming complexity into simplicity.
!!!###!!!title=calendar introduction——VisActor/VTable tutorial documents!!!###!!!!!!###!!!description=A calendar is a common table used to display dates and corresponding schedules. VTable-Calendar is a calendar component developed based on the VTable component. Users can quickly implement a calendar tool or customize related business functions based on the powerful capabilities of VTable. Compared with traditional calendars, VTable-Calendar has the following advantages:- Stepless scrolling function, supports scrolling across months and years- Users familiar with VTable api can quickly get started with custom functions!!!###!!!
Calendar
A calendar is a common table used to display dates and corresponding schedules. VTable-Calendar is a calendar component developed based on the VTable component. Users can quickly implement a calendar tool or customize related business functions based on the powerful capabilities of VTable. Compared with traditional calendars, VTable-Calendar has the following advantages:
Stepless scrolling function, supports scrolling across months and years
Users familiar with VTable api can quickly get started with custom functions
Basic configuration of calendar
When creating a calendar, you can pass in the configuration corresponding to the calendar day:
Among them, option supports the following attributes
Attribute
Type
Description
startDate
Date
Calendar start date
endDate
Date
Calendar end date
currentDate
Date
Calendar day displayed
rangeDays
number
The range of days displayed in the calendar (if startDate&endDate is not configured, the dates of rangeDays before and after currentDate will be taken as startDate&endDate, the default is 90 days)
dayTitles
string[]
Calendar title (can be replaced with different languages)
customEventOptions
ICustomEventOptions
Custom schedule configuration
customEvents
ICustomEvent[]
Array of custom schedules
tableOptions
ListTableConstructorOptions
Calendar table configuration (the configuration here will be passed to the corresponding VTable instance for deep customization)
The properties configured in tableOptions can be referred to VTable configuration for further configuration of the table. For example, if you want Saturday to be displayed in blue and Sunday in red in the calendar title, you can use the following configuration:
Customized calendar
Calendar supports two ways to customize the calendar, one for a single day and one for a multi-day schedule. The configuration of custom schedule is as follows:
export interface ICustomEvent {
type: 'list' | 'bar'; // Schedule type, list is a schedule within a single day, bar is a schedule across multiple daysid: string; // Schedule id, used to distinguish different schedules startDate?: Date; // Schedule start date (for schedules across multiple days) endDate?: Date; // Schedule end date (for schedules across multiple days)date?: Date; // Schedule date (for schedules within a single day)text: string;
color?: string; // text color bgColor?: string; // bar background color customInfo?: any; // user custom data}
Custom schedules can be configured during initialization, or dynamically added, deleted, and updated through the API.