Skip to content

Commit

Permalink
Merge pull request #29143 from c3024/28622-fix-next-month-available-d…
Browse files Browse the repository at this point in the history
…ates-check

fix check of available dates of next month
  • Loading branch information
cristipaval authored Oct 13, 2023
2 parents 7eead96 + b04f313 commit 4569744
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/NewDatePicker/CalendarPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class CalendarPicker extends React.PureComponent {
const currentMonthView = this.state.currentDateView.getMonth();
const currentYearView = this.state.currentDateView.getFullYear();
const calendarDaysMatrix = generateMonthMatrix(currentYearView, currentMonthView);
const hasAvailableDatesNextMonth = moment(this.props.maxDate).endOf('month').startOf('day') > moment(this.state.currentDateView).add(1, 'months');
const hasAvailableDatesPrevMonth = moment(this.props.minDate).startOf('day') < moment(this.state.currentDateView).subtract(1, 'months').endOf('month');
const hasAvailableDatesNextMonth = moment(this.props.maxDate).endOf('month').endOf('day') >= moment(this.state.currentDateView).add(1, 'months');
const hasAvailableDatesPrevMonth = moment(this.props.minDate).startOf('month').startOf('day') <= moment(this.state.currentDateView).subtract(1, 'months');

return (
<View>
Expand Down

0 comments on commit 4569744

Please sign in to comment.