Skip to content

Commit

Permalink
Merge pull request #9 from JessevanAssen/master
Browse files Browse the repository at this point in the history
Allow 'en' in the list of supported locales
  • Loading branch information
iamakulov authored May 23, 2018
2 parents 45c74a7 + 334b7cb commit 33c13cf
Show file tree
Hide file tree
Showing 3 changed files with 1,224 additions and 1,203 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@ function normalizeLocalesToKeep(localesToKeep) {
);
}

// Check if has unknown locales
// 'en' is built into Moment, so it doesn't exist in the locales context
localesToKeep = localesToKeep.filter(function(localeName) {
return localeName !== 'en';
});

// Check if it has unknown locales
var absentLocales = localesToKeep.filter(function(localeName) {
const localeData = moment.localeData(localeName);
var 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
// For Moment. 2.21.0+ – this version now returns the localeData of the currently set locale, instead of null
localeData === moment.localeData()
);
});
Expand Down
Loading

0 comments on commit 33c13cf

Please sign in to comment.