From 1c8098ecce863e581f47380435afcc9275a218aa Mon Sep 17 00:00:00 2001 From: Yashwanth Maheshwaram Date: Wed, 30 Jan 2019 15:44:11 +0530 Subject: [PATCH] bug fix for month increment - February is going amiss in some cases. --- src/Calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Calendar.js b/src/Calendar.js index d321572..9e131d7 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -131,9 +131,9 @@ export default class Calendar extends React.Component { })); if (isFutureDate) { - monthIterator.setMonth(monthIterator.getMonth() + 1); + monthIterator.setMonth(monthIterator.getMonth() + 1, 1); } else { - monthIterator.setMonth(monthIterator.getMonth() - 1); + monthIterator.setMonth(monthIterator.getMonth() - 1, 1); } }