View as Markdown

API reference: @salmonui/scheduler

SchedulerViewConfiginterface

import type { SchedulerViewConfig } from '@salmonui/scheduler';
interface SchedulerViewConfig<Row = unknown> {
    readonly type: SchedulerViewType;
    readonly name?: string;
    readonly label?: string;
    readonly interval?: number;
    readonly startHour?: string;
    readonly endHour?: string;
    readonly workDays?: readonly number[];
    readonly showWeekend?: boolean;
    readonly readOnly?: boolean;
    readonly dateFormat?: Intl.DateTimeFormatOptions;
    readonly timeScale?: SchedulerTimeScale;
    readonly renderEvent?: (ctx: SchedulerEventRenderContext<Row>) => ReactNode;
    readonly eventLayout?: SchedulerEventLayout;
    readonly monthCount?: number;
    readonly firstMonthOfYear?: number;
    readonly agendaDayCount?: number;
    readonly hideEmptyAgendaDays?: boolean;
    readonly orientation?: 'horizontal' | 'vertical';
    readonly virtualScroll?: boolean | SchedulerVirtualScroll;
    readonly headerRows?: readonly SchedulerHeaderRow[];
    readonly renderMonthHeader?: (ctx: SchedulerMonthHeaderContext) => ReactNode;
    readonly renderDayHeader?: (ctx: SchedulerDayHeaderContext) => ReactNode;
}

One view entry of views: overrides the top-level prop of the same name for that view.

SchedulerViewConfig members (22)
NameSignatureDescription
typereadonly type: SchedulerViewType;
nameoptionalreadonly name?: string;

Name used by view (default type; give distinct names to two entries of one type).

labeloptionalreadonly label?: string;

Button label (default from localeText).

intervaloptionalreadonly interval?: number;

Days, weeks, months or years per page (a 3-day view: { type: 'day', interval: 3 }).

startHouroptionalreadonly startHour?: string;
endHouroptionalreadonly endHour?: string;
workDaysoptionalreadonly workDays?: readonly number[];
showWeekendoptionalreadonly showWeekend?: boolean;
readOnlyoptionalreadonly readOnly?: boolean;
dateFormatoptionalreadonly dateFormat?: Intl.DateTimeFormatOptions;
timeScaleoptionalreadonly timeScale?: SchedulerTimeScale;
renderEventoptionalreadonly renderEvent?: (ctx: SchedulerEventRenderContext<Row>) => ReactNode;
eventLayoutoptionalreadonly eventLayout?: SchedulerEventLayout;
monthCountoptionalreadonly monthCount?: number;

Year views: months per page and the first month.

firstMonthOfYearoptionalreadonly firstMonthOfYear?: number;
agendaDayCountoptionalreadonly agendaDayCount?: number;

Agenda: days per page.

hideEmptyAgendaDaysoptionalreadonly hideEmptyAgendaDays?: boolean;

Agenda: skip days without events (default true).

orientationoptionalreadonly orientation?: 'horizontal' | 'vertical';

Timeline Year: months as rows ('horizontal', default) or as columns.

virtualScrolloptionalreadonly virtualScroll?: boolean | SchedulerVirtualScroll;

Virtual scrolling of timeline resource rows or of the agenda days.

headerRowsoptionalreadonly headerRows?: readonly SchedulerHeaderRow[];

Timeline header rows.

renderMonthHeaderoptionalreadonly renderMonthHeader?: (ctx: SchedulerMonthHeaderContext) => ReactNode;

Year and Timeline Year month and weekday headers.

renderDayHeaderoptionalreadonly renderDayHeader?: (ctx: SchedulerDayHeaderContext) => ReactNode;