Skip to content

Commit

Permalink
Allow showFixedNumberOfWeeks to be explicitly defined when `showDou…
Browse files Browse the repository at this point in the history
…bleView` is true. (#413)
  • Loading branch information
frankleng committed Jan 17, 2022
1 parent f9b7ea4 commit 3a8106b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Displays a complete, interactive calendar.
|prev2AriaLabel|`aria-label` attribute of the "previous on higher level" button on the navigation pane.|n/a|`"Jump backwards"`|
|prev2Label|Content of the "previous on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon.|`"«"`|<ul><li>String: `"«"`</li><li>React element: `<DoublePreviousIcon />`</li></ul>|
|returnValue|Which dates shall be passed by the calendar to the onChange function and onClick{Period} functions. Can be `"start"`, `"end"` or `"range"`. The latter will cause an array with start and end values to be passed.|`"start"`|`"range"`|
|showDoubleView|Whether to show two months/years/… at a time instead of one. Forces `showFixedNumberOfWeeks` prop to be `true`.|`false`|`true`|
|showDoubleView|Whether to show two months/years/… at a time instead of one. Defaults `showFixedNumberOfWeeks` prop to be `true`.|`false`|`true`|
|showFixedNumberOfWeeks|Whether to always show fixed number of weeks (6). Forces `showNeighboringMonth` prop to be `true`.|`false`|`true`|
|showNavigation|Whether a navigation bar with arrows and title shall be rendered.|`true`|`false`|
|showNeighboringMonth|Whether days from previous or next month shall be rendered if the month doesn't start on the first day of the week or doesn't end on the last day of the week, respectively.|`true`|`false`|
Expand Down
2 changes: 1 addition & 1 deletion src/Calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ export default class Calendar extends Component {
formatShortWeekday={formatShortWeekday}
onClickWeekNumber={onClickWeekNumber}
onMouseLeave={selectRange ? onMouseLeave : null}
showFixedNumberOfWeeks={showFixedNumberOfWeeks || showDoubleView}
showFixedNumberOfWeeks={typeof showFixedNumberOfWeeks !== 'undefined' ? showFixedNumberOfWeeks : showDoubleView}
showNeighboringMonth={showNeighboringMonth}
showWeekNumbers={showWeekNumbers}
{...commonProps}
Expand Down

0 comments on commit 3a8106b

Please sign in to comment.