From 3a8106b052e1cfd8320f7df7124e7cef0c147868 Mon Sep 17 00:00:00 2001 From: Frank Leng Date: Mon, 17 Jan 2022 02:20:51 -0800 Subject: [PATCH] Allow `showFixedNumberOfWeeks` to be explicitly defined when `showDoubleView` is true. (#413) --- README.md | 2 +- src/Calendar.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7200c261..82ba1382 100644 --- a/README.md +++ b/README.md @@ -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.|`"«"`|| |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`| diff --git a/src/Calendar.jsx b/src/Calendar.jsx index ef18acf7..adf7be3b 100644 --- a/src/Calendar.jsx +++ b/src/Calendar.jsx @@ -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}