12 lines
329 B
JavaScript
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;
|
|
}
|