Skip to content

Commit 2083933

Browse files
fix(calendar): display startDate as first month in range selection
- Fixes issue #5939
1 parent 09af697 commit 2083933

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ export class DatePicker extends Component<DatePickerProps, DatePickerState> {
336336
) {
337337
this.setState({ monthSelectedIn: 0 });
338338
}
339+
if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
340+
this.setState({ monthSelectedIn: 0 });
341+
}
339342
if (prevProps.highlightDates !== this.props.highlightDates) {
340343
this.setState({
341344
highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -1518,6 +1521,8 @@ export class DatePicker extends Component<DatePickerProps, DatePickerState> {
15181521
}
15191522

15201523
render(): React.ReactElement | null {
1524+
console.log("Test");
1525+
15211526
const calendar = this.renderCalendar();
15221527

15231528
if (this.props.inline) return calendar;

0 commit comments

Comments
 (0)