From c3363ee0e3808d826c4e4797ffa7207647435e08 Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
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/planner.tsx')

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 (
     <div
       className="bg-white dark:bg-slate-800 p-4 rounded-lg shadow mb-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-700 border border-gray-200 dark:border-slate-700"
@@ -193,11 +186,15 @@ const ItinerarySummary = ({
         <span className="flex items-center gap-3">
           <span className="flex items-center gap-1 font-semibold text-slate-700 dark:text-slate-300">
             <Coins className="w-4 h-4" />
-            {formatCurrency(cashFare)}
+            {cashFare === "0.00"
+              ? t("planner.free")
+              : t("planner.fare", { amount: cashFare })}
           </span>
           <span className="flex items-center gap-1 text-slate-600 dark:text-slate-400">
             <CreditCard className="w-4 h-4" />
-            {t("planner.card_fare", { amount: cardFare })}
+            {cardFare === "0.00"
+              ? t("planner.free")
+              : t("planner.fare", { amount: cardFare })}
           </span>
         </span>
       </div>
@@ -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

