mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-03-04 07:18:50 -07:00
fix: city validation
This commit is contained in:
parent
c28e5fcad5
commit
b4713b86e2
1 changed files with 3 additions and 3 deletions
|
@ -164,10 +164,10 @@ const age = $computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const timeForThem = $computed(() => {
|
const timeForThem = $computed(() => {
|
||||||
const tzInfo = cityTimezones.lookupViaCity(props.user.location!);
|
const tzInfo = cityTimezones.lookupViaCity(props.user.location!.replace(/\s.*/,''));
|
||||||
if (tzInfo.length == 0) return "";
|
if (tzInfo.length == 0) return "";
|
||||||
const theirTz = tzInfo[0].timezone;
|
const tz = tzInfo[0].timezone;
|
||||||
const theirTime = new Date().toLocaleString("en-US", { timeZone: theirTz, hour12: true })
|
const theirTime = new Date().toLocaleString("en-US", { timeZone: tz, hour12: true })
|
||||||
return ` (${theirTime.split(",")[1].trim().split(":")[0]} ${theirTime.split(" ")[1].slice(-2)})`
|
return ` (${theirTime.split(",")[1].trim().split(":")[0]} ${theirTime.split(" ")[1].slice(-2)})`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue