nouveau-theatre-de-besancon/assets/js/calendar.js
2024-07-24 09:43:31 +02:00

12 lines
329 B
JavaScript

dayjs.locale("fr");
function getDaysInMonth(month, year) {
const daysInMonth = dayjs(new Date(year, month, 0)).daysInMonth();
const days = [];
for (let day = 1; day <= daysInMonth; day++) {
const currentDay = dayjs(new Date(year, month - 1, day));
days.push(currentDay.format("DD-MM-YYYY"));
}
return days;
}