react-big-calendar - Including missing props for the Calendar component. (#14937)

* Including missing props for the Calendar component.

* Updated the test to reflect the changes to the d.ts

* Updating the version.
This commit is contained in:
Dan Foley 2017-03-10 06:45:12 +00:00 committed by Mohamed Hegazy
parent 35a2d1886b
commit 7b9040fa32
2 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for react-big-calendar 0.11
// Type definitions for react-big-calendar 0.12.3
// Project: https://github.com/intljusticemission/react-big-calendar
// Definitions by: Piotr Witek <http://piotrwitek.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -26,10 +26,10 @@ declare module 'react-big-calendar' {
step?: number;
rtl?: boolean;
eventPropGetter?: (event: Object, start: stringOrDate, end: stringOrDate, isSelected: boolean) => void;
titleAccessor?: string;
allDayAccessor?: boolean;
startAccessor?: stringOrDate;
endAccessor?: stringOrDate;
titleAccessor?: string | ((row: Object) => string);
allDayAccessor?: string | ((row: Object) => boolean);
startAccessor?: string | ((row: Object) => Date);
endAccessor?: string | ((row: Object) => Date);
min?: stringOrDate;
max?: stringOrDate;
scrollToTime?: stringOrDate;
@ -38,6 +38,8 @@ declare module 'react-big-calendar' {
messages?: Object;
timeslots?: number;
defaultView?: string;
className?: string;
elementProps?: React.HTMLAttributes<HTMLElement>;
}
class BigCalendar extends React.Component<BigCalendarProps, {}> {

View File

@ -58,10 +58,10 @@ const FullAPIExample = React.createClass({
step={20}
rtl={true}
eventPropGetter={(event, start, end, isSelected) => { } }
titleAccessor={'string'}
allDayAccessor={true}
startAccessor={new Date()}
endAccessor={new Date()}
titleAccessor={'title'}
allDayAccessor={(row:any) => !!row.allDay}
startAccessor={'start'}
endAccessor={(row:any) => row.end || row.start}
min={new Date()}
max={new Date()}
scrollToTime={new Date()}
@ -70,6 +70,8 @@ const FullAPIExample = React.createClass({
messages={{}}
timeslots={24}
defaultView={'month'}
className={'my-calendar'}
elementProps={{id: 'myCalendar'}}
/>
);
}