Skip to content

Commit

Permalink
Fix #1661: Calendar do not navigate past min and max
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jul 1, 2022
1 parent 4a983cf commit f7e3293
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api-generator/components/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const CalendarProps = [
description: 'Maximum number of selectable dates in multiple mode.'
},
{
name: 'showOutliers',
name: 'showMinMaxRange',
type: 'boolean',
default: 'true',
description: 'Whether to allow navigation past min/max dates.'
Expand Down
2 changes: 1 addition & 1 deletion components/doc/calendar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ const monthNavigatorTemplate = (options) => {
<td>Maximum number of selectable dates in multiple mode.</td>
</tr>
<tr>
<td>showOutliers</td>
<td>showMinMaxRange</td>
<td>boolean</td>
<td>true</td>
<td>Whether to allow navigation past min/max dates.</td>
Expand Down
2 changes: 1 addition & 1 deletion components/lib/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export interface CalendarProps {
minDate?: Date;
maxDate?: Date;
maxDateCount?: number;
showOutliers?: boolean;
showMinMaxRange?: boolean;
showOtherMonths?: boolean;
selectOtherMonths?: boolean;
showButtonBar?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ export const Calendar = React.memo(React.forwardRef((props, ref) => {
}

const setNavigationState = (newViewDate) => {
if (!props.showOutliers || props.view !== 'date' || !overlayRef.current) {
if (!props.showMinMaxRange || props.view !== 'date' || !overlayRef.current) {
return;
}

Expand Down Expand Up @@ -3160,7 +3160,7 @@ Calendar.defaultProps = {
minDate: null,
maxDate: null,
maxDateCount: null,
showOutliers: true,
showMinMaxRange: false,
showOtherMonths: true,
selectOtherMonths: false,
showButtonBar: false,
Expand Down

0 comments on commit f7e3293

Please sign in to comment.