Skip to content

Commit

Permalink
fix(monthPicker): selected month follows preselected month
Browse files Browse the repository at this point in the history
When preselected month changes, the 'react-datepicker__month-text--selected' class stays on the selected month.
  • Loading branch information
KevinFabre-ods committed Jun 21, 2023
1 parent 4b01708 commit 6415325
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/month.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ export default class Month extends React.Component {
q === utils.getQuarter(utils.newDate());

isSelectedMonth = (day, m, selected) =>
utils.getMonth(day) === m && utils.getYear(day) === utils.getYear(selected);
utils.getMonth(selected) === m &&
utils.getYear(day) === utils.getYear(selected);

isSelectedQuarter = (day, q, selected) =>
utils.getQuarter(day) === q &&
Expand Down

0 comments on commit 6415325

Please sign in to comment.