Files
DefinitelyTyped/react-calendar-timeline/react-calendar-timeline-tests.tsx
Rajab Shakirov 9ee4cbccdc update react-calendar-timeline.d.ts for ES6 module system support. (#9272)
* update react-calendar-timeline.d.ts
by issue: https://github.com/namespace-ee/react-calendar-timeline/issues/17#issuecomment-217128161

* update definitions for ES6 module system support.
2016-05-15 00:05:57 +09:00

33 lines
1.1 KiB
TypeScript

/// <reference path="../react/react.d.ts" />
/// <reference path="../moment/moment.d.ts" />
/// <reference path="./react-calendar-timeline.d.ts"/>
import * as React from "react";
import * as moment from 'moment';
import ReactCalendarTimeline from 'react-calendar-timeline';
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')}
]
class ExampleOfUsingReactCalendarTimeline extends React.Component<{}, {}> {
render(){
return(
<div>
Rendered by react!
<ReactCalendarTimeline groups={groups}
items={items}
defaultTimeStart={moment().add(-12, 'hour')}
defaultTimeEnd={moment().add(12, 'hour')}
/>
</div>
);
}
};