FIX: prevents exception and more duplicates (#8396)

This commit is contained in:
Joffrey JAFFEUX 2019-11-22 19:43:37 +01:00 committed by GitHub
parent 0a6b29a942
commit c498780479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -125,6 +125,10 @@
}
function _isEqualZones(timezoneA, timezoneB) {
if ((timezoneA || timezoneB) && (!timezoneA || !timezoneB)) {
return false;
}
if (timezoneA.includes(timezoneB) || timezoneB.includes(timezoneA)) {
return true;
}
@ -250,7 +254,7 @@
timezones.unshift(options.timezone);
}
timezones.filter(Boolean).forEach(timezone => {
Array.from(new Set(timezones.filter(Boolean))).forEach(timezone => {
if (_isEqualZones(timezone, displayedTimezone)) {
return;
}