- No data for this period
+ Sin datos para este período
) : (
@@ -248,7 +248,7 @@ export default function Analytics() {
{daily.length === 0 ? (
- No data for this period
+ Sin datos para este período
) : (
@@ -272,7 +272,7 @@ export default function Analytics() {
formatCRC(Number(value))}
labelFormatter={(label) =>
- new Date(label).toLocaleDateString('en-US', { month: 'short', day: 'numeric' })
+ new Date(label).toLocaleDateString('es-CR', { month: 'short', day: 'numeric' })
}
/>
}
diff --git a/frontend/src/pages/Budget.tsx b/frontend/src/pages/Budget.tsx
index 86af5c7..b644a6a 100644
--- a/frontend/src/pages/Budget.tsx
+++ b/frontend/src/pages/Budget.tsx
@@ -4,6 +4,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
import { toast } from 'sonner';
import api, { type Transaction } from '@/lib/api';
+import { MONTH_NAMES_ES as MONTH_NAMES } from '@/lib/dates';
import { useBudget } from '@/hooks/useBudget';
import { Button } from '@/components/ui/button';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
@@ -12,10 +13,6 @@ import MonthlyDetail from '@/components/budget/MonthlyDetail';
import RecurringItemsManager from '@/components/budget/RecurringItemsManager';
import TransactionList from '@/components/TransactionList';
-const MONTH_NAMES = [
- '', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
- 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre',
-];
const MIN_YEAR = 2026;
const MAX_YEAR = 2030;
diff --git a/frontend/src/pages/ServiciosMunicipales.tsx b/frontend/src/pages/ServiciosMunicipales.tsx
index 6e58deb..6ec4cd3 100644
--- a/frontend/src/pages/ServiciosMunicipales.tsx
+++ b/frontend/src/pages/ServiciosMunicipales.tsx
@@ -1,5 +1,6 @@
import { useState, useCallback, useRef, useMemo } from 'react';
import { useQuery } from '@tanstack/react-query';
+import { MONTH_NAMES_ES_SHORT as MONTH_NAMES_ES } from '@/lib/dates';
import ErrorState from '@/components/ErrorState';
import {
BarChart,
@@ -53,10 +54,6 @@ const METER_COLORS: Record = {
'9345': '#f59e0b',
};
-const MONTH_NAMES_ES = [
- 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
- 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic',
-];
const DEFAULT_METER_COLOR = '#8b5cf6';
@@ -67,7 +64,8 @@ const formatCRC = (amount: number): string =>
function periodLabel(period: string): string {
const [yearStr, monthStr] = period.split('-');
- const monthIdx = parseInt(monthStr, 10) - 1;
+ // The shared month array is 1-indexed ('' at index 0).
+ const monthIdx = parseInt(monthStr, 10);
return `${MONTH_NAMES_ES[monthIdx]} ${yearStr.slice(2)}`;
}