From 1009d7c9764b01c8814d82fb0fe8d2f32b21ff13 Mon Sep 17 00:00:00 2001 From: Tudor Date: Sun, 29 Mar 2026 20:17:04 +0100 Subject: [PATCH] fix(chart): format year as 2022/23 instead of 202223 on performance chart Co-Authored-By: Claude Sonnet 4.6 --- nextjs-app/components/PerformanceChart.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nextjs-app/components/PerformanceChart.tsx b/nextjs-app/components/PerformanceChart.tsx index 79a2f7a..6978789 100644 --- a/nextjs-app/components/PerformanceChart.tsx +++ b/nextjs-app/components/PerformanceChart.tsx @@ -40,7 +40,11 @@ interface PerformanceChartProps { export function PerformanceChart({ data, schoolName, isSecondary = false }: PerformanceChartProps) { // Sort data by year const sortedData = [...data].sort((a, b) => a.year - b.year); - const years = sortedData.map(d => d.year.toString()); + const formatYear = (y: number) => { + const s = y.toString(); + return s.length === 6 ? `${s.slice(0, 4)}/${s.slice(4)}` : s; + }; + const years = sortedData.map(d => formatYear(d.year)); // Prepare datasets — phase-aware const datasets = isSecondary ? [