Browse Source

catch timezone error if browser do not have

philippdormann/feature/release-management
LouisLam 4 years ago
parent
commit
b3a5d868a7
  1. 9
      src/util-frontend.js

9
src/util-frontend.js

@ -362,15 +362,17 @@ const aryIannaTimeZones = [
'Pacific/Efate',
'Pacific/Wallis',
'Pacific/Apia',
'Africa/Johannesburg'
'Africa/Johannesburg',
];
export function timezoneList() {
let result = [];
for (let timezone of aryIannaTimeZones) {
try {
let display = dayjs().tz(timezone).format("Z");
result.push({
@ -378,6 +380,11 @@ export function timezoneList() {
value: timezone,
time: getTimezoneOffset(timezone),
})
} catch (e) {
console.log(e.message);
console.log("Skip this timezone")
}
}
result.sort((a, b) => {

Loading…
Cancel
Save