Fix timezone error

This commit is contained in:
Dragon Fire
2021-04-25 23:03:59 -04:00
parent 06fb9764b0
commit 816fcad07d
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -15,9 +15,9 @@ module.exports = class TimezoneType extends ArgumentType {
new ZipToTz().full(value);
return true;
} catch {
const cityZone = cityTimezones.lookupViaCity(value);
const cityZone = cityTimezones.lookupViaCity(value).filter(res => res.timezone);
if (cityZone.length) return true;
const provZone = cityTimezones.findFromCityStateProvince(value);
const provZone = cityTimezones.findFromCityStateProvince(value).filter(res => res.timezone);
if (provZone.length) return true;
}
return false;
@@ -30,9 +30,9 @@ module.exports = class TimezoneType extends ArgumentType {
const zipZone = new ZipToTz().full(value);
return zipZone;
} catch {
const cityZone = cityTimezones.lookupViaCity(value);
const cityZone = cityTimezones.lookupViaCity(value).filter(res => res.timezone);
if (cityZone.length) return cityZone[0].timezone;
const provZone = cityTimezones.findFromCityStateProvince(value);
const provZone = cityTimezones.findFromCityStateProvince(value).filter(res => res.timezone);
if (provZone.length) return provZone[0].timezone;
}
return null;