Skip to content

Commit ba1230e

Browse files
committed
map popup: format the demolition permit date too
Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
1 parent d620f31 commit ba1230e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

components/MapView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import maplibregl, { type Map as MapLibreMap, type GeoJSONSource } from "maplibr
55
import type { MapProject } from "@/lib/projects";
66
import type { ProjectFilters, ProjectType } from "@/lib/types";
77
import { TYPE_COLORS, TYPE_LABELS, STATUS_LABELS } from "@/lib/types";
8+
import { formatYMD } from "@/lib/dates";
89

910
interface Props {
1011
points: MapProject[];
@@ -200,7 +201,7 @@ export default function MapView({ points, filters }: Props) {
200201
const coords = (f.geometry as unknown as { coordinates: [number, number] }).coordinates;
201202
new maplibregl.Popup({ closeButton: true, offset: 8 })
202203
.setLngLat(coords)
203-
.setHTML(`<div class="text-xs"><div class="uppercase tracking-wider opacity-60 text-[10px]">Demolition permit</div><div class="mt-1">${f.properties?.event_date || ""}</div></div>`)
204+
.setHTML(`<div class="text-xs"><div class="uppercase tracking-wider opacity-60 text-[10px]">Demolition permit</div><div class="mt-1">${formatYMD(f.properties?.event_date) || ""}</div></div>`)
204205
.addTo(map);
205206
});
206207

0 commit comments

Comments
 (0)