Skip to content

Commit

Permalink
Merge pull request #219 from timrwood/warn-when-loading-twice
Browse files Browse the repository at this point in the history
Log an error if moment timezone was already loaded. #212
  • Loading branch information
mattjohnsonpint committed May 13, 2015
2 parents 532cf3e + fe0ff9d commit 3c82b06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moment-timezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"use strict";

// Do not load moment-timezone a second time.
if (moment.tz !== undefined) { return moment; }
if (moment.tz !== undefined) {
logError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion);
return moment;
}

var VERSION = "0.3.1",
zones = {},
Expand Down

0 comments on commit 3c82b06

Please sign in to comment.