diff --git a/assets/js/calendar.js b/assets/js/calendar.js index c4b11f9..8a10c17 100644 --- a/assets/js/calendar.js +++ b/assets/js/calendar.js @@ -2,11 +2,12 @@ dayjs.locale("fr"); function getDatesInMonth(month) { const year = dayjs().month(month).year(); - const daysInMonth = dayjs(new Date(year, month, 0)).daysInMonth(); + const daysInMonth = dayjs(new Date(year, month, 0)).daysInMonth() + 1; const dates = {}; for (let day = 1; day <= daysInMonth; day++) { - const currentDay = dayjs(new Date(year, month - 1, day)); + const currentDay = dayjs(new Date(year, month, day)); + console.log(currentDay.format("DD-MM-YYYY")); dates[parseInt(currentDay.format("DD"))] = []; } diff --git a/site/snippets/calendar-strip.php b/site/snippets/calendar-strip.php index 5616702..0156d48 100644 --- a/site/snippets/calendar-strip.php +++ b/site/snippets/calendar-strip.php @@ -19,7 +19,7 @@ this.dates[day].push(mapadoDate.name) }) - console.log(this.dates) + console.log('dates', this.dates) } }"