From c3363ee0e3808d826c4e4797ffa7207647435e08 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Fri, 12 Dec 2025 18:40:12 +0100 Subject: feat: add comfort parameters to AppConfiguration and update OTP service for Madrid timezone handling --- src/frontend/app/routes/planner.tsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/frontend/app/routes') diff --git a/src/frontend/app/routes/planner.tsx b/src/frontend/app/routes/planner.tsx index 0f52fef..5121dce 100644 --- a/src/frontend/app/routes/planner.tsx +++ b/src/frontend/app/routes/planner.tsx @@ -104,10 +104,12 @@ const ItinerarySummary = ({ const startTime = new Date(itinerary.startTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", }); const endTime = new Date(itinerary.endTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", }); const walkTotals = sumWalkMetrics(itinerary.legs); @@ -121,15 +123,6 @@ const ItinerarySummary = ({ itinerary.cardFareEuro ?? busLegsCount * FARE_CARD_PER_BUS ).toFixed(2); - // Format currency based on locale (ES/GL: "1,50 €", EN: "€1.50") - const formatCurrency = (amount: string) => { - const isSpanishOrGalician = - i18n.language.startsWith("es") || i18n.language.startsWith("gl"); - return isSpanishOrGalician - ? t("planner.cash_fare", { amount }) - : t("planner.cash_fare", { amount }); - }; - return (
- {formatCurrency(cashFare)} + {cashFare === "0.00" + ? t("planner.free") + : t("planner.fare", { amount: cashFare })} - {t("planner.card_fare", { amount: cardFare })} + {cardFare === "0.00" + ? t("planner.free") + : t("planner.fare", { amount: cardFare })}
@@ -628,6 +625,7 @@ const ItineraryDetail = ({ {new Date(leg.startTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", })}{" "} -{" "} {( @@ -812,6 +810,7 @@ export default function PlannerPage() { ? new Date(searchTime).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", + timeZone: "Europe/Madrid", }) : null; -- cgit v1.3