import { menuMonths } from "https://esm.town/v/tal/menuMonths";
export function currentDateValues(): {
schoolYear: `${number}-${number}`;
month: string;
} {
const menuDate = new Date();
const actualYear = menuDate.getFullYear();
const currentMonth = menuMonths[menuDate.getMonth()];
let schoolYear: `${number}-${number}`;
if (
currentMonth === "September" || currentMonth === "October" ||
currentMonth === "November" || currentMonth === "December"
) {
schoolYear = `${actualYear}-${actualYear + 1}`;
}
else {
schoolYear = `${actualYear - 1}-${actualYear}`;
}
return {
schoolYear,
month: currentMonth,
};
}