Fix timezone search

This commit is contained in:
Dragon Fire
2021-04-24 17:44:22 -04:00
parent 70b8526795
commit 5bc2613c01
+2 -4
View File
@@ -9,8 +9,7 @@ module.exports = class TimezoneType extends ArgumentType {
}
validate(value) {
value = value.replaceAll(' ', '_').toLowerCase();
const directZone = moment.tz.zone(value);
const directZone = moment.tz.zone(value.replaceAll(' ', '_').toLowerCase());
if (directZone) return true;
try {
new ZipToTz().full(value);
@@ -25,8 +24,7 @@ module.exports = class TimezoneType extends ArgumentType {
}
parse(value) {
value = value.replaceAll(' ', '_').toLowerCase();
const directZone = moment.tz.zone(value);
const directZone = moment.tz.zone(value.replaceAll(' ', '_').toLowerCase());
if (directZone) return directZone.name;
try {
const zipZone = new ZipToTz().full(value);