Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed return type for View parameter #1677

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Calendar extends React.Component {
/**
*
* ```js
* (dates: Date[] | { start: Date; end: Date }, view?: 'month'|'week'|'work_week'|'day'|'agenda') => void
* (dates: Date[] | { start: Date; end: Date }, view: 'month'|'week'|'work_week'|'day'|'agenda'|undefined) => void
* ```
*
* Callback fired when the visible date range changes. Returns an Array of dates
Expand Down Expand Up @@ -486,14 +486,23 @@ class Calendar extends React.Component {

/**
* Optionally provide a function that returns an object of className or style props
* to be applied to the the time-slot node. Caution! Styles that change layout or
* to be applied to the time-slot node. Caution! Styles that change layout or
* position may break the calendar in unexpected ways.
*
* ```js
* (date: Date, resourceId: (number|string)) => { className?: string, style?: Object }
* ```
*/
slotPropGetter: PropTypes.func,
slotPropGetter: PropTypes.func,

/**
* Optionally provide a function that returns an object of props to be applied
* to the time-slot group node. Useful to dynamically change the sizing of time nodes.
* ```js
* () => { style?: Object }
* ```
*/
slotGroupPropGetter: PropTypes.func,

/**
* Optionally provide a function that returns an object of className or style props
Expand Down Expand Up @@ -775,7 +784,8 @@ class Calendar extends React.Component {
resourceIdAccessor,
resourceTitleAccessor,
eventPropGetter,
slotPropGetter,
slotPropGetter,
slotGroupPropGetter,
dayPropGetter,
view,
views,
Expand All @@ -794,7 +804,9 @@ class Calendar extends React.Component {
eventProp: (...args) =>
(eventPropGetter && eventPropGetter(...args)) || {},
slotProp: (...args) =>
(slotPropGetter && slotPropGetter(...args)) || {},
(slotPropGetter && slotPropGetter(...args)) || {},
slotGroupProp: (...args) =>
(slotGroupPropGetter && slotGroupPropGetter(...args)) || {},
dayProp: (...args) => (dayPropGetter && dayPropGetter(...args)) || {},
},
components: defaults(components[view] || {}, omit(components, names), {
Expand Down