⬆️ geo-tz to browser-geo-tz (#1322)

* ⬆️ geo-tz to tz-lookup

* 🐛 Handle multiple timezones return

* ⬆️ change tz-lookup to browser-geo-tz
This commit is contained in:
Tagaishi
2023-09-01 17:15:25 +02:00
committed by GitHub
parent 78627f7b51
commit eb3bbfb025
3 changed files with 1423 additions and 41 deletions

View File

@@ -61,13 +61,13 @@
"@trpc/server": "^10.29.1",
"@vitejs/plugin-react": "^4.0.0",
"axios": "^1.0.0",
"browser-geo-tz": "^0.0.4",
"consola": "^3.0.0",
"cookies-next": "^2.1.1",
"dayjs": "^1.11.7",
"dockerode": "^3.3.2",
"fily-publish-gridstack": "^0.0.13",
"framer-motion": "^10.0.0",
"geo-tz": "^7.0.7",
"html-entities": "^2.3.3",
"i18next": "^22.5.1",
"immer": "^10.0.2",

View File

@@ -1,5 +1,5 @@
import { z } from 'zod';
import { find } from 'geo-tz'
const GeoTz = require('browser-geo-tz/dist/geotz.js');
import { createTRPCRouter, publicProcedure } from '../trpc';
@@ -12,6 +12,7 @@ export const timezoneRouter = createTRPCRouter({
})
)
.query(async ({ input }) => {
return find(input.latitude,input.longitude)[0];
const timezone = GeoTz.find(input.latitude,input.longitude);
return Array.isArray(timezone) ? timezone[0] : timezone;
}),
})

1457
yarn.lock

File diff suppressed because it is too large Load Diff