24 lines
540 B
JavaScript
24 lines
540 B
JavaScript
document.addEventListener("DOMContentLoaded", function () {
|
||
const yearDropdown = document.getElementById("year");
|
||
|
||
const currentYear = new Date().getFullYear();
|
||
const startYear = 1990;
|
||
|
||
for (let y = currentYear; y >= startYear; y--) {
|
||
let nextYear = y + 1;
|
||
|
||
let option = document.createElement("option");
|
||
|
||
// Backend receives only first year (example 2024)
|
||
option.value = y;
|
||
|
||
// User sees (example AY 2024–2025)
|
||
option.textContent = `AY ${y}-${nextYear}`;
|
||
|
||
yearDropdown.appendChild(option);
|
||
}
|
||
});
|
||
|
||
|
||
|