Skip to content

Commit

Permalink
add responsiveness to calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Tubo committed Jun 20, 2024
1 parent f2176c5 commit 46d2b60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions radscheduler/static/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ const calendarEl = document.getElementById('calendar');
let calendar = new Calendar(calendarEl, {
plugins: [dayGridPlugin, listPlugin, bootstrap5Plugin],
initialView: window.innerWidth > 768 ? 'dayGridMonth' : 'listWeek',
windowResize: function (view) {
// If the window is resized to a width greater than 768px, change the view to dayGridMonth
if (window.innerWidth > 768) {
calendar.changeView('dayGridMonth');
} else {
calendar.changeView('listWeek');
}
},
themeSystem: 'bootstrap5',
events: "/api/calendar/events/",
locale: nzLocale,
Expand Down

0 comments on commit 46d2b60

Please sign in to comment.