mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-29 07:18:08 +09:00
improve city search
This commit is contained in:
parent
4de7c51623
commit
818bdcbd18
@ -353,18 +353,28 @@ const age = $computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const timeForThem = $computed(() => {
|
const timeForThem = $computed(() => {
|
||||||
const tzInfo = cityTimezones.lookupViaCity(
|
const maybeCityNames = [
|
||||||
props.user.location!.replace(/\s.*/, "")
|
props.user.location!,
|
||||||
);
|
props.user.location!.replace(/[^A-Za-z].*/, ""),
|
||||||
if (tzInfo.length == 0) return "";
|
props.user.location!.replace(/[^A-Za-z\-\'\.].*/, ""),
|
||||||
const tz = tzInfo[0].timezone;
|
props.user.location!.replace(/[^A-Za-z0-9\-\'\.\s].*/, ""),
|
||||||
const theirTime = new Date().toLocaleString("en-US", {
|
];
|
||||||
timeZone: tz,
|
|
||||||
hour12: false,
|
for (const city of maybeCityNames) {
|
||||||
});
|
let tzInfo = cityTimezones.lookupViaCity(city);
|
||||||
return ` (${theirTime.split(",")[1].trim().split(":")[0]}:${theirTime
|
if (tzInfo.length == 0) continue;
|
||||||
.split(" ")[1]
|
|
||||||
.slice(-5, -3)})`;
|
const tz = tzInfo[0].timezone;
|
||||||
|
const theirTime = new Date().toLocaleString("en-US", {
|
||||||
|
timeZone: tz,
|
||||||
|
hour12: false,
|
||||||
|
});
|
||||||
|
return ` (${theirTime.split(",")[1].trim().split(":")[0]}:${theirTime
|
||||||
|
.split(" ")[1]
|
||||||
|
.slice(-5, -3)})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
});
|
});
|
||||||
|
|
||||||
function menu(ev) {
|
function menu(ev) {
|
||||||
|
Loading…
Reference in New Issue
Block a user