mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-08 11:17:51 +00:00
refactor map popups and add inspect trackpoint feature
This commit is contained in:
@@ -12,6 +12,7 @@ import mapboxgl from "mapbox-gl";
|
||||
import tilebelt from "@mapbox/tilebelt";
|
||||
import { PUBLIC_MAPBOX_TOKEN } from "$env/static/public";
|
||||
import PNGReader from "png.js";
|
||||
import type { DateFormatter } from "@internationalized/date";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
@@ -215,4 +216,16 @@ export function getURLForLanguage(lang: string | null | undefined, path: string)
|
||||
return `${base}${newPath}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getDateFormatter(locale: string) {
|
||||
return new Intl.DateTimeFormat(locale, {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'medium'
|
||||
});
|
||||
}
|
||||
|
||||
export let df: DateFormatter = getDateFormatter('en');
|
||||
locale.subscribe((l) => {
|
||||
df = getDateFormatter(l ?? 'en');
|
||||
});
|
Reference in New Issue
Block a user