diff --git a/frontend/src/app/golfbaner/[slug]/CourseDisplay.tsx b/frontend/src/app/golfbaner/[slug]/CourseDisplay.tsx index 8e1423d..a3a6219 100644 --- a/frontend/src/app/golfbaner/[slug]/CourseDisplay.tsx +++ b/frontend/src/app/golfbaner/[slug]/CourseDisplay.tsx @@ -5,7 +5,6 @@ import { STATUS_MAP } from "@/config/constants"; // Designerens definisjon av fargetemaer - Nå med kraftigere tints for kolonnene const getTeeTheme = (label: string) => { const name = label.toLowerCase(); - if (name.includes("svart") || name.includes("black")) { return { header: "bg-gray-900 text-white", col: "bg-gray-100", text: "text-gray-900" }; } @@ -53,6 +52,7 @@ export default function CourseDisplay({ course }: { course: any }) { // Kalkulering av SpH const activeTee = availableTees[selectedTeeIndex]; let playingHandicap = 0; + if (activeTee && hcp) { const exactHcp = Number(hcp.replace(',', '.')); const slope = Number(activeTee.slopeverdi || activeTee.slopeverdi_damer || 113); @@ -69,6 +69,11 @@ export default function CourseDisplay({ course }: { course: any }) { const sumPar = (holes: any[]) => holes.reduce((acc, h) => acc + (h.par || 0), 0); const sumLen = (holes: any[], key: string) => holes.reduce((acc, h) => acc + (h.lengths?.[key] || 0), 0); + + // Formater utløpsdato + const slopeExpiry = course.slope_valid_until + ? new Date(course.slope_valid_until).toLocaleDateString('nb-NO', { year: 'numeric', month: 'short', day: 'numeric' }) + : 'Ukjent'; return (
Par {course.par} • {course.length_meters || '--'} meter
-+ Par {course.par} • {course.length_meters || '--'} meter +
++ Rating utløper: {slopeExpiry} +
+