FIX: prevents exception and more duplicates (#8396)
This commit is contained in:
parent
0a6b29a942
commit
c498780479
|
@ -125,6 +125,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function _isEqualZones(timezoneA, timezoneB) {
|
function _isEqualZones(timezoneA, timezoneB) {
|
||||||
|
if ((timezoneA || timezoneB) && (!timezoneA || !timezoneB)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (timezoneA.includes(timezoneB) || timezoneB.includes(timezoneA)) {
|
if (timezoneA.includes(timezoneB) || timezoneB.includes(timezoneA)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +254,7 @@
|
||||||
timezones.unshift(options.timezone);
|
timezones.unshift(options.timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
timezones.filter(Boolean).forEach(timezone => {
|
Array.from(new Set(timezones.filter(Boolean))).forEach(timezone => {
|
||||||
if (_isEqualZones(timezone, displayedTimezone)) {
|
if (_isEqualZones(timezone, displayedTimezone)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue