From 28f750f7c4265ec6f3cb9a59acf951d2ec3baeda Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 22 Nov 2026 22:28:09 +0100 Subject: [PATCH] fix(pdf): give formatMoney a locale, lower the strict entry of the export lint:strict: a place's price passed the export's locale, which can be undefined, to formatMoney; it falls back to en like the export's other money figures. The rewritten TripPDF.tsx holds 1 strict error instead of 38, and its entry is lowered to that. --- client/scripts/strict-baseline.json | 2 +- client/src/components/PDF/tripPdfDay.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/scripts/strict-baseline.json b/client/scripts/strict-baseline.json index 39862b5de..8a4ffd8ea 100644 --- a/client/scripts/strict-baseline.json +++ b/client/scripts/strict-baseline.json @@ -43,7 +43,7 @@ "src/components/Map/ReservationOverlay.test.tsx": 1, "src/components/Map/transitGeometry.ts": 1, "src/components/Map/useMarkerThumbs.ts": 1, - "src/components/PDF/TripPDF.tsx": 38, + "src/components/PDF/TripPDF.tsx": 1, "src/components/Planner/DayPlanSidebar.constants.ts": 1, "src/components/Planner/DayPlanSidebar.tsx": 52, "src/components/Planner/DayPlanSidebarNoteModal.test.tsx": 1, diff --git a/client/src/components/PDF/tripPdfDay.ts b/client/src/components/PDF/tripPdfDay.ts index 0cae2413a..fcc7999b8 100644 --- a/client/src/components/PDF/tripPdfDay.ts +++ b/client/src/components/PDF/tripPdfDay.ts @@ -261,7 +261,7 @@ function placeFacts(place: Assignment['place'] & Partial, ctx: PdfDayCont const price = Number(place.price); if (Number.isFinite(price) && price > 0) { facts.push( - `${glyph('price', 9)}${escHtml(formatMoney(price, place.currency || ctx.tripCurrency, ctx.locale))}` + `${glyph('price', 9)}${escHtml(formatMoney(price, place.currency || ctx.tripCurrency, ctx.locale || 'en'))}` ); } if (typeof place.rating_avg === 'number' && place.rating_avg > 0) {