From cb445b28e92e0e6bc05ca4f4328347ed4bd43bd6 Mon Sep 17 00:00:00 2001 From: MadMG Date: Wed, 4 Mar 2015 15:51:23 +0100 Subject: [PATCH] Only check for nodejs (require) if `moment` is not globally accessible. Fix for usage with `momentjs` with `ember-cli`. --- moment-jdateformatparser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moment-jdateformatparser.js b/moment-jdateformatparser.js index a6140c0..25a91c8 100644 --- a/moment-jdateformatparser.js +++ b/moment-jdateformatparser.js @@ -157,7 +157,7 @@ } } - if (typeof require !== 'undefined' && require !== null) { + 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 hookMoment(require('moment')); //if it is, we have to require it different (without the surrounding Array) } else {