Skip to content

Commit

Permalink
fix arqex#848
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-carebit committed Jan 15, 2025
1 parent 3d04b53 commit a2b3749
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"fs-extra": "^8.1.0",
"html-webpack-plugin": "4.0.0-beta.5",
"identity-obj-proxy": "3.0.0",
"jest": "24.9.0",
"jest": "^29.7.0",
"jest-environment-jsdom-fourteen": "0.1.0",
"jest-resolve": "24.9.0",
"jest-watch-typeahead": "0.4.2",
Expand Down
14 changes: 7 additions & 7 deletions src/DateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,19 @@ 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 ) );
}

let update = {viewDate: viewDate};
if ( currentView === updateOnView ) {
// 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 ) {
update.selectedDate = viewDate.clone();
update.inputValue = viewDate.format( this.getFormat('datetime') );

Expand Down

0 comments on commit a2b3749

Please sign in to comment.