react line scheduler
npm install react-line-schedbash
via yarn
yarn add react-line-sched
via npm
npm install --save react-line-sched
`
Usage
At the very minimum:
`jsx
import Timeline from 'react-line-sched'
// make sure you include the timeline stylesheet or the timeline will not be styled
import 'react-line-sched/lib/Timeline.css'
import moment from 'moment'
const groups = [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]
const items = [
{
id: 1,
group: 1,
title: 'item 1',
start_time: moment(),
end_time: moment().add(1, 'hour')
},
{
id: 2,
group: 2,
title: 'item 2',
start_time: moment().add(-0.5, 'hour'),
end_time: moment().add(0.5, 'hour')
},
{
id: 3,
group: 1,
title: 'item 3',
start_time: moment().add(2, 'hour'),
end_time: moment().add(3, 'hour')
}
]
ReactDOM.render(
Rendered by react!
groups={groups}
items={items}
defaultTimeStart={moment().add(-12, 'hour')}
defaultTimeEnd={moment().add(12, 'hour')}
/>
,
document.getElementById('root')
)
``