Muuta päättynyt sopimus -> jatkuva (vihreä)

Määräaikaisuuden päätyttyä sopimus jatkuu toistaiseksi voimassa
olevana, joten näytetään "(jatkuva)" vihreällä punaisella
"(päättynyt)" sijaan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 08:27:42 +02:00
parent 417728683c
commit cc974f0aa8

View File

@@ -436,7 +436,7 @@ function contractRemaining(sopimuskausi, alkupvm) {
end.setMonth(end.getMonth() + months); end.setMonth(end.getMonth() + months);
const now = new Date(); const now = new Date();
const diffMs = end - now; const diffMs = end - now;
if (diffMs <= 0) return `${months} kk <span style="color:#e74c3c;font-size:0.8rem;">(päättynyt)</span>`; if (diffMs <= 0) return `${months} kk <span style="color:#27ae60;font-size:0.8rem;">(jatkuva)</span>`;
const remainMonths = Math.ceil(diffMs / (1000 * 60 * 60 * 24 * 30.44)); const remainMonths = Math.ceil(diffMs / (1000 * 60 * 60 * 24 * 30.44));
return `${months} kk <span style="color:#888;font-size:0.8rem;">(${remainMonths} kk jäljellä)</span>`; return `${months} kk <span style="color:#888;font-size:0.8rem;">(${remainMonths} kk jäljellä)</span>`;
} }