From fd2e59230af42deaa075f01d2c7052709c8b3abc Mon Sep 17 00:00:00 2001 From: Manda Date: Mon, 13 Feb 2023 13:14:17 +0530 Subject: [PATCH 1/2] Issue while selecting previous month date from FEBRUARY. #852 --- src/DateTime.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/DateTime.js b/src/DateTime.js index 6b2e8aebb..746f086e6 100644 --- a/src/DateTime.js +++ b/src/DateTime.js @@ -338,16 +338,15 @@ export default class Datetime extends React.Component { let updateOnView = this.getUpdateOn( this.getFormat('date') ); let viewDate = this.state.viewDate.clone(); - // Set the value into day/month/year - viewDate[ this.viewToMethod[currentView] ]( - parseInt( e.target.getAttribute('data-value'), 10 ) - ); - // Need to set month and year will for days view (prev/next month) if ( currentView === 'days' ) { viewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) ); viewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) ); } + // Set the value into day/month/year + viewDate[ this.viewToMethod[currentView] ]( + parseInt( e.target.getAttribute('data-value'), 10 ) + ); let update = {viewDate: viewDate}; if ( currentView === updateOnView ) { From 93d8c440a10296e800492da46c70fc9303e6165a Mon Sep 17 00:00:00 2001 From: Manda Date: Mon, 13 Feb 2023 15:08:35 +0530 Subject: [PATCH 2/2] Issue while selecting previous month date from FEBRUARY. #852 --- src/DateTime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DateTime.js b/src/DateTime.js index 746f086e6..0840135a4 100644 --- a/src/DateTime.js +++ b/src/DateTime.js @@ -340,8 +340,8 @@ export default class Datetime extends React.Component { // Need to set month and year will for days view (prev/next month) if ( currentView === 'days' ) { - viewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) ); viewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) ); + viewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) ); } // Set the value into day/month/year viewDate[ this.viewToMethod[currentView] ](