Skip to content

Commit

Permalink
Log an error if moment timezone was already loaded. moment#212
Browse files Browse the repository at this point in the history
  • Loading branch information
timrwood committed May 12, 2015
1 parent 532cf3e commit fe0ff9d
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 fe0ff9d

Please sign in to comment.