mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +00:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -261,7 +261,7 @@ function placeFacts(place: Assignment['place'] & Partial<Place>, ctx: PdfDayCont
|
||||
const price = Number(place.price);
|
||||
if (Number.isFinite(price) && price > 0) {
|
||||
facts.push(
|
||||
`<span class="chip chip-green">${glyph('price', 9)}${escHtml(formatMoney(price, place.currency || ctx.tripCurrency, ctx.locale))}</span>`
|
||||
`<span class="chip chip-green">${glyph('price', 9)}${escHtml(formatMoney(price, place.currency || ctx.tripCurrency, ctx.locale || 'en'))}</span>`
|
||||
);
|
||||
}
|
||||
if (typeof place.rating_avg === 'number' && place.rating_avg > 0) {
|
||||
|
||||
Reference in New Issue
Block a user