Skip to content

Commit 633d002

Browse files
committed
fix arqex#848
1 parent 3d04b53 commit 633d002

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

dist/react-datetime.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-datetime.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-datetime.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-datetime.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DateTime.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,19 @@ export default class Datetime extends React.Component {
338338
let updateOnView = this.getUpdateOn( this.getFormat('date') );
339339
let viewDate = this.state.viewDate.clone();
340340

341-
// Set the value into day/month/year
342-
viewDate[ this.viewToMethod[currentView] ](
343-
parseInt( e.target.getAttribute('data-value'), 10 )
344-
);
345-
346341
// Need to set month and year will for days view (prev/next month)
347342
if ( currentView === 'days' ) {
348343
viewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );
349344
viewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );
350345
}
351346

352-
let update = {viewDate: viewDate};
353-
if ( currentView === updateOnView ) {
347+
// Set the value into day/month/year
348+
viewDate[ this.viewToMethod[currentView] ](
349+
parseInt( e.target.getAttribute('data-value'), 10 )
350+
);
351+
352+
let update = {viewDate: viewDate};
353+
if ( currentView === updateOnView ) {
354354
update.selectedDate = viewDate.clone();
355355
update.inputValue = viewDate.format( this.getFormat('datetime') );
356356

0 commit comments

Comments
 (0)