Skip to content

Commit

Permalink
Merge pull request #15 from zhaozhiming/master
Browse files Browse the repository at this point in the history
clear the webpack warning
  • Loading branch information
herom committed Jul 21, 2017
2 parents b52ce85 + a6d3a02 commit 458fbf0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions moment-jdateformatparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@
}
}

if (typeof this.moment === 'undefined' && typeof require !== 'undefined' && require !== null) {
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { //Check if the environment is Node.js
if (!this.moment && typeof require === 'function') {
if (module && module.exports) { //Check if the environment is Node.js
hookMoment(require('moment')); //if it is, we have to require it different (without the surrounding Array)
} else {
require(['moment'], function (moment) {
Expand All @@ -188,7 +188,6 @@
hookMoment(this.moment);
}


/**
* Translates the java date format String to a momentjs format String.
*
Expand Down

0 comments on commit 458fbf0

Please sign in to comment.