Skip to content

Commit

Permalink
Handle undefined DTF locale (#572)
Browse files Browse the repository at this point in the history
Trying to fix #571, no easy repro case. Specs seem to imply that locale should always be defined though, but since there was already a special case for 'und'...
  • Loading branch information
GillesDebunne authored and icambron committed Sep 14, 2019
1 parent 5bf9b3a commit b6c47c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/impl/locale.js
Expand Up @@ -44,7 +44,7 @@ function systemLocale() {
} else if (hasIntl()) {
const computedSys = new Intl.DateTimeFormat().resolvedOptions().locale;
// node sometimes defaults to "und". Override that because that is dumb
sysLocaleCache = computedSys === "und" ? "en-US" : computedSys;
sysLocaleCache = (!computedSys || computedSys === "und") ? "en-US" : computedSys;
return sysLocaleCache;
} else {
sysLocaleCache = "en-US";
Expand Down

0 comments on commit b6c47c4

Please sign in to comment.