Skip to content

Commit

Permalink
Merge pull request #803 from nnatter/patch-1
Browse files Browse the repository at this point in the history
Call correct log method in DateTime component to prevent crash on invalid input
  • Loading branch information
arqex authored Sep 6, 2021
2 parents 4e880f2 + 7b47655 commit 8071a79
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/DateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,8 @@ export default class Datetime extends React.Component {
* @public
*/
setViewDate( date ) {
let me = this;
let logError = function() {
return me.log( 'Invalid date passed to the `setViewDate` method: ' + date );
return log( 'Invalid date passed to the `setViewDate` method: ' + date );
};

if ( !date ) return logError();
Expand Down

0 comments on commit 8071a79

Please sign in to comment.