Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@
#calendar {
height: 800px;
}

#calendarMonth {
min-width: 150px;
text-align: center;
font-size: 1.2em;
font-weight: bold;
line-height: 2.5;
}
16 changes: 13 additions & 3 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,19 @@ const loadCalendar = async () => {
})
;

document.querySelector('#calendarToday').onclick = () => { calendar.today(); };
document.querySelector('#calendarNext').onclick = () => { calendar.next(); };
document.querySelector('#calendarPrevious').onclick = () => { calendar.prev(); };
const monthNames = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'];
const updateMonthDisplay = () => {
const date = calendar.getDate();
const monthElement = document.querySelector('#calendarMonth');
if (monthElement) {
monthElement.textContent = monthNames[date.getMonth()] + ' ' + date.getFullYear();
}
};
updateMonthDisplay();

document.querySelector('#calendarToday').onclick = () => { calendar.today(); updateMonthDisplay(); };
document.querySelector('#calendarNext').onclick = () => { calendar.next(); updateMonthDisplay(); };
document.querySelector('#calendarPrevious').onclick = () => { calendar.prev(); updateMonthDisplay(); };

};

Expand Down
1 change: 1 addition & 0 deletions src/pages/calendar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Layout from '../layouts/Layout.astro';
<i class="fa fa-chevron-left fa-lg"></i>
</span>
</button>
<span class="nav-item" id="calendarMonth"></span>
<button type="button" class="button is-default nav-item" id ="calendarNext">
<span class="icon is-medium">
<i class="fa fa-chevron-right fa-lg"></i>
Expand Down