mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 02:34:44 +00:00
This commit is contained in:
@@ -4,14 +4,15 @@ if (!Grocy.CalendarFirstDayOfWeek.isEmpty())
|
||||
firstDay = parseInt(Grocy.CalendarFirstDayOfWeek);
|
||||
}
|
||||
|
||||
$("#calendar").fullCalendar({
|
||||
var calendar = $("#calendar").fullCalendar({
|
||||
"themeSystem": "bootstrap4",
|
||||
"header": {
|
||||
"left": "month,basicWeek,listWeek",
|
||||
"left": "month,agendaWeek,agendaDay,listWeek",
|
||||
"center": "title",
|
||||
"right": "prev,next"
|
||||
},
|
||||
"weekNumbers": Grocy.CalendarShowWeekNumbers,
|
||||
"defaultView": ($(window).width() < 768) ? "agendaDay" : "month",
|
||||
"firstDay": firstDay,
|
||||
"eventLimit": true,
|
||||
"eventSources": fullcalendarEventSources
|
||||
@@ -35,3 +36,17 @@ $("#ical-button").on("click", function(e)
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$(window).on("resize", function()
|
||||
{
|
||||
// Automatically switch the calendar to "basicDay" view on small screens
|
||||
// and to "month" otherwise
|
||||
if ($(window).width() < 768)
|
||||
{
|
||||
calendar.fullCalendar("changeView", "agendaDay");
|
||||
}
|
||||
else
|
||||
{
|
||||
calendar.fullCalendar("changeView", "month");
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user