Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into jstrimpel-master
Browse files Browse the repository at this point in the history
  • Loading branch information
iamakulov committed Mar 24, 2018
2 parents db20d52 + e2fc2ba commit 8a48df4
Show file tree
Hide file tree
Showing 4 changed files with 8,064 additions and 7,088 deletions.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ function normalizeLocalesToKeep(localesToKeep) {

// Check if has unknown locales
var absentLocales = localesToKeep.filter(function(localeName) {
return moment.localeData(localeName) === null;
const localeData = moment.localeData(localeName);
return (
// For Moment 2.20.1−
localeData === null ||
// For Moment. 2.21.0+ – this version now returns a default locale instead of null
localeData === moment.localeData()
);
});
if (absentLocales.length > 0) {
throw new Error(
Expand Down
Loading

0 comments on commit 8a48df4

Please sign in to comment.