mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-27 22:49:42 -08:00
catch timezone error if browser do not have
This commit is contained in:
parent
312dec7393
commit
b3a5d868a7
|
@ -362,15 +362,17 @@ const aryIannaTimeZones = [
|
||||||
'Pacific/Efate',
|
'Pacific/Efate',
|
||||||
'Pacific/Wallis',
|
'Pacific/Wallis',
|
||||||
'Pacific/Apia',
|
'Pacific/Apia',
|
||||||
'Africa/Johannesburg'
|
'Africa/Johannesburg',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export function timezoneList() {
|
export function timezoneList() {
|
||||||
|
|
||||||
let result = [];
|
let result = [];
|
||||||
|
|
||||||
for (let timezone of aryIannaTimeZones) {
|
for (let timezone of aryIannaTimeZones) {
|
||||||
|
|
||||||
|
try {
|
||||||
let display = dayjs().tz(timezone).format("Z");
|
let display = dayjs().tz(timezone).format("Z");
|
||||||
|
|
||||||
result.push({
|
result.push({
|
||||||
|
@ -378,6 +380,11 @@ export function timezoneList() {
|
||||||
value: timezone,
|
value: timezone,
|
||||||
time: getTimezoneOffset(timezone),
|
time: getTimezoneOffset(timezone),
|
||||||
})
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e.message);
|
||||||
|
console.log("Skip this timezone")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.sort((a, b) => {
|
result.sort((a, b) => {
|
||||||
|
|
Loading…
Reference in a new issue