Agrupar las tarjetas de CaMa y elegir el periodo en Trazabilidad

This commit is contained in:
2026-12-03 22:21:59 -06:00
parent 84769cb0f4
commit 2a84eb56ca
12 changed files with 142 additions and 120 deletions
+7
View File
@@ -23,6 +23,13 @@ export function periods(type: PeriodType, years = 6, today = new Date()): string
return found;
}
/** Historical periods ending in the selected month or semester, oldest first. */
export function historyPeriods(type: PeriodType, selected: string): string[] {
const [year, part] = selected.split('-');
const month = type === 'semester' ? (part === 'S1' ? 0 : 6) : Number(part) - 1;
return periods(type, 6, new Date(Number(year), month, 1)).reverse();
}
export function periodLabel(period: string): string {
const [year, part] = period.split('-');
if (part.startsWith('S')) return `${part === 'S1' ? 'Ene–Jun' : 'Jul–Dic'} ${year}`;