Localization sweep: shared es-CR dates module, no more en-US strays

src/lib/dates.ts is the single source for month names and date
formatting; the three per-page month arrays are gone (with an
off-by-one guard — the shared array is 1-indexed). formatDate and the
Analytics chart tooltips now speak es-CR, Analytics headings are
Spanish, and the cycle selector says 'Todo el período' (UX-19, FE-17,
UX-07).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-06-10 17:59:16 -06:00
parent cdfa4ad90a
commit 8b7f3dff40
7 changed files with 42 additions and 20 deletions

View File

@@ -49,7 +49,7 @@ export default function BillingCycleSelector({ value, onChange }: Props) {
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="all">All time</SelectItem>
<SelectItem value="all">Todo el período</SelectItem>
{cycles.map((c) => (
<SelectItem key={`${c.year}-${c.month}`} value={`${c.year}-${c.month}`}>
{c.label} ({c.count})

View File

@@ -1,4 +1,5 @@
import ConfirmDialog from '@/components/ConfirmDialog';
import { MONTH_NAMES_ES_SHORT as MONTH_NAMES } from '@/lib/dates';
import { useState, useRef, useEffect } from 'react';
import { Pencil } from 'lucide-react';
@@ -15,10 +16,6 @@ import {
TableRow,
} from '@/components/ui/table';
const MONTH_NAMES = [
'', 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic',
];
const FRESH_START_YEAR = 2026;
const FRESH_START_MONTH = 3;