add dropdown year as AY yyyy formate and seprate css files commit
This commit is contained in:
23
static/js/year_dropdown.js
Normal file
23
static/js/year_dropdown.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user