Timeline View

The Timeline view displays events on a continuous time-scale.

Getting Started

The following example demonstrates how to set common properties of the Timeline view of the Scheduler. For the full list of configuration options, refer to the API reference of the TimelineView properties.

import React from 'react';
import ReactDOM from 'react-dom';

import { Scheduler, TimelineView } from '@progress/kendo-react-scheduler';
import { sampleData, displayDate } from './events-utc.js';
import { Day } from '@progress/kendo-date-math';

const App = () => {
    return (
        <Scheduler
            data={sampleData}
            defaultDate={displayDate}
        >
            <TimelineView
                title="Hour-By-Hour"

                numberOfDays={2}

                columnWidth={100}
                slotDuration={60}
                slotDivisions={1}

                startTime={"08:00"}
                endTime={"18:00"}

                workDayStart={"09:00"}
                workDayEnd={"17:00"}

                workWeekStart={Day.Sunday}
                workWeekEnd={Day.Monday}

                showWorkHours={false}
            />
        </Scheduler>
    )
}

ReactDOM.render(<App />, document.querySelector('my-app'));

Grouping by Resource

You can configure the Timeline view to display events that are grouped by a resource.

import React from 'react';
import ReactDOM from 'react-dom';

import { Scheduler, TimelineView } from '@progress/kendo-react-scheduler';
import { sampleDataWithResources, displayDate } from './events-utc.js';

const App = () => {
    const [orientation, setOrientation] = React.useState('vertical');

    const handleOrientationChange = React.useCallback(
        (event) => { setOrientation(event.target.value) },
        [setOrientation]
    );

    return (
        <div>
            <div className="example-config">
                <label>
                    Horizontal &nbsp;
                    <input type="radio" value="horizontal" checked={orientation === 'horizontal'} onChange={handleOrientationChange} />
                </label>
                &nbsp;
            <label>
                    Vertical &nbsp;
                    <input type="radio" value="vertical" checked={orientation === 'vertical'} onChange={handleOrientationChange} />
                </label>
            </div>
            <Scheduler
                data={sampleDataWithResources}
                defaultDate={displayDate}
                group={{
                    resources: ['Rooms', 'Persons'],
                    orientation
                }}
                resources={[
                    {
                        name: 'Rooms',
                        data: [
                            { text: 'Meeting Room 101', value: 1 },
                            { text: 'Meeting Room 201', value: 2, color: 'green' }
                        ],
                        field: 'roomId',
                        valueField: 'value',
                        textField: 'text',
                        colorField: 'color'
                    },
                    {
                        name: 'Persons',
                        data: [
                            { text: 'Peter', value: 1, color: 'red' },
                            { text: 'Alex', value: 2 }
                        ],
                        field: 'personId',
                        multiple: true,
                        valueField: 'value',
                        textField: 'text',
                        colorField: 'color'
                    }]}
            >
                <TimelineView
                    title="Hour-By-Hour"

                    columnWidth={100}
                    slotDuration={120}
                    slotDivisions={1}
                    numberOfDays={2}

                    workDayStart={"08:00"}
                    workDayEnd={"18:00"}
                />
            </Scheduler>
        </div>
    )
}

ReactDOM.render(<App />, document.querySelector('my-app'));

Setting the First Weekday

The first day of the week is determined by the current locale. For an example on how to change the locale, refer to the article about globalization.

Future releases will include an option for overriding the first day of the week through the properties of the component.

 /