From 73b18cbc7c209df1845ad9da07f1f1a0bfb6c38a Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Sat, 14 Dec 2024 19:54:12 +0100
Subject: [PATCH 1/7] Update humhub.calendar.Calendar.js

---
 resources/js/humhub.calendar.Calendar.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/resources/js/humhub.calendar.Calendar.js b/resources/js/humhub.calendar.Calendar.js
index 7be409cd..2e344d6c 100644
--- a/resources/js/humhub.calendar.Calendar.js
+++ b/resources/js/humhub.calendar.Calendar.js
@@ -171,7 +171,7 @@ humhub.module('calendar.Calendar', function (module, require, $) {
             header: {
                 left: 'prev,next today',
                 center: 'title',
-                right: 'create dayGridMonth,timeGridWeek,timeGridDay,listWeek'
+                right: 'create dayGridMonth,timeGridWeek,timeGridDay,listYear'
             },
             buttonText: buttonText,
             plugins: ['dayGrid', 'timeGrid', 'list', 'interaction', 'bootstrap', 'moment', 'momentTimezone'],
@@ -197,7 +197,7 @@ humhub.module('calendar.Calendar', function (module, require, $) {
                 right: 'today'
             };
             options.footer = {
-                center: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek',
+                center: 'dayGridMonth,timeGridWeek,timeGridDay,listYear',
                 right: 'create'
             };
         }
@@ -328,4 +328,4 @@ humhub.module('calendar.Calendar', function (module, require, $) {
     };
 
     module.export = Calendar;
-});
\ No newline at end of file
+});

From 1074613cb22e7ef49b161391ff89d3f75af8a902 Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Sat, 14 Dec 2024 20:42:27 +0100
Subject: [PATCH 2/7] Update humhub.calendar.Calendar.min.js

---
 resources/js/humhub.calendar.Calendar.min.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/resources/js/humhub.calendar.Calendar.min.js b/resources/js/humhub.calendar.Calendar.min.js
index fd71acfd..4b42fb96 100644
--- a/resources/js/humhub.calendar.Calendar.min.js
+++ b/resources/js/humhub.calendar.Calendar.min.js
@@ -1 +1 @@
-humhub.module("calendar.Calendar",function(i,t,r){var e=t("ui.widget").Widget,l=t("client"),n=t("util").string,o=t("ui.loader"),s=t("ui.view"),d=t("ui.modal"),a=e.extend();a.prototype.init=function(){var n=this;this.options.events=function(t,e,o){r.ajax({url:n.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:n.options.selectors,filters:n.options.filters,types:n.options.types},success:function(t){e(t)}})},i.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},a.prototype.initCalendarFilter=function(){var t=this;r(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),r(".filterCheckbox").click(function(){"3"==r(this).val()&&r(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==r(this).val()&&r(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),r('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},a.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],r(".selectorCheckbox").each(function(){r(this).prop("checked")&&e.options.selectors.push(r(this).val())}),r(".filterCheckbox").each(function(){r(this).prop("checked")&&e.options.filters.push(r(this).val())}),e.options.types=r('select[name="filterType[]"]').val(),this.initFullCalendar(t)},a.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},a.prototype.getDefaultOptions=function(){var t={};"today"!==i.text("button.today")&&(t.today=i.text("button.today")),"month"!==i.text("button.month")&&(t.month=i.text("button.month")),"week"!==i.text("button.week")&&(t.week=i.text("button.week")),"day"!==i.text("button.day")&&(t.day=i.text("button.day")),"list"!==i.text("button.list")&&(t.list=i.text("button.list"));var a=this,e={customButtons:{create:{click:function(){var t=new Date;t.setHours(t.getHours()+1),t.setMinutes(0,0,0);var e=new Date;e.setHours(e.getHours()+2),e.setMinutes(0,0,0);var o={data:{start:a.toJsonDateFormat(t,!1),end:a.toJsonDateFormat(e,!1),cal:1}},n=a.options.global?a.options.globalCreateUrl:a.options.editUrl;d.global.load(n,o).then(function(){d.global.$.one("hidden.bs.modal submitted",function(){a.fetch()})}).catch(function(t){d.global.close(),i.log.error(t,!0)}),a.fullCalendar.unselect()},bootstrapFontAwesome:"fa-plus"}},header:{left:"prev,next today",center:"title",right:"create dayGridMonth,timeGridWeek,timeGridDay,listWeek"},buttonText:t,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:r.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:r.proxy(this.loader,this),eventResize:r.proxy(this.updateEvent,this),eventDrop:r.proxy(this.updateEvent,this),eventClick:r.proxy(this.clickEvent,this),eventRender:r.proxy(this.renderEvent,this)};return s.isSmall()&&(e.header={left:"prev,next",center:"title",right:"today"},e.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listWeek",right:"create"}),e},a.prototype.renderEvent=function(t,e){var o=r(e);o.attr({title:o.text()}),t.icon&&n.startsWith(t.icon,"fa-")&&o.find(".fc-content").prepend(r('<i class="fa '+t.icon+'"></i>'))},a.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},a.prototype.select=function(t){var e=this,o={data:{start:this.toJsonDateFormat(t.start,!1),end:this.toJsonDateFormat(t.end,!1),cal:1}};"dayGridMonth"===t.view.type&&(o.data.view="month");var n=this.options.global?this.options.globalCreateUrl:this.options.editUrl;d.global.load(n,o).then(function(){d.global.$.one("hidden.bs.modal submitted",function(){e.fetch()})}).catch(function(t){d.global.close(),i.log.error(t,!0)}),this.fullCalendar.unselect()},a.prototype.fetch=function(){this.fullCalendar.refetchEvents()},a.prototype.updateEvent=function(e){var o=this,t=e.event,n=t.extendedProps,a={data:{id:t.id,start:this.toJsonDateFormat(t.start,t.allDay),end:this.toJsonDateFormat(t.end,t.allDay)}};this.loader(),l.post(n.updateUrl,a).then(function(t){t.success?i.log.success("saved"):i.log.error(t,!0),n.refreshAfterUpdate&&o.fetch()}).catch(function(t){i.log.error(t,!0),e.revert()}).finally(function(){o.loader(!1)})},a.prototype.clickEvent=function(t){var e=t.event.extendedProps;if(e.viewUrl){var o=this;"modal"===e.viewMode?d.global.load(e.viewUrl,{viewContext:"fullCalendar"}).then(function(){d.global.set({backdrop:!0}),d.global.$.one("hidden.bs.modal",function(){o.fetch()})}).catch(function(t){i.log.error(t,!0),d.global.close()}):l.pjax.redirect(e.viewUrl)}},a.prototype.loader=function(t){!1===t?o.reset(r("#calendar-overview-loader")):o.set(r("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},i.export=a});
\ No newline at end of file
+humhub.module("calendar.Calendar",function(t,e,o){var n=e("ui.widget").Widget,a=e("client"),i=e("util").string,r=e("ui.loader"),l=e("ui.view"),s=e("ui.modal"),d=n.extend();d.prototype.init=function(){var e=this;this.options.events=function(t,n,a){o.ajax({url:e.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:e.options.selectors,filters:e.options.filters,types:e.options.types},success:function(t){n(t)}})},t.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},d.prototype.initCalendarFilter=function(){var t=this;o(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),o(".filterCheckbox").click(function(){"3"==o(this).val()&&o(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==o(this).val()&&o(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),o('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},d.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],o(".selectorCheckbox").each(function(){o(this).prop("checked")&&e.options.selectors.push(o(this).val())}),o(".filterCheckbox").each(function(){o(this).prop("checked")&&e.options.filters.push(o(this).val())}),e.options.types=o('select[name="filterType[]"]').val(),this.initFullCalendar(t)},d.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},d.prototype.getDefaultOptions=function(){var e={};"today"!==t.text("button.today")&&(e.today=t.text("button.today")),"month"!==t.text("button.month")&&(e.month=t.text("button.month")),"week"!==t.text("button.week")&&(e.week=t.text("button.week")),"day"!==t.text("button.day")&&(e.day=t.text("button.day")),"list"!==t.text("button.list")&&(e.list=t.text("button.list"));var n=this,a={customButtons:{create:{click:function(){var e=new Date;e.setHours(e.getHours()+1),e.setMinutes(0,0,0);var o=new Date;o.setHours(o.getHours()+2),o.setMinutes(0,0,0);var a={data:{start:n.toJsonDateFormat(e,!1),end:n.toJsonDateFormat(o,!1),cal:1}},i=n.options.global?n.options.globalCreateUrl:n.options.editUrl;s.global.load(i,a).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){n.fetch()})}).catch(function(e){s.global.close(),t.log.error(e,!0)}),n.fullCalendar.unselect()},bootstrapFontAwesome:"fa-plus"}},header:{left:"prev,next today",center:"title",right:"create dayGridMonth,timeGridWeek,timeGridDay,listYear"},buttonText:e,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:o.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:o.proxy(this.loader,this),eventResize:o.proxy(this.updateEvent,this),eventDrop:o.proxy(this.updateEvent,this),eventClick:o.proxy(this.clickEvent,this),eventRender:o.proxy(this.renderEvent,this)};return l.isSmall()&&(a.header={left:"prev,next",center:"title",right:"today"},a.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listYear",right:"create"}),a},d.prototype.renderEvent=function(t,e){var n=o(e);n.attr({title:n.text()}),t.icon&&i.startsWith(t.icon,"fa-")&&n.find(".fc-content").prepend(o('<i class="fa '+t.icon+'"></i>'))},d.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},d.prototype.select=function(e){var o=this,n={data:{start:this.toJsonDateFormat(e.start,!1),end:this.toJsonDateFormat(e.end,!1),cal:1}};"dayGridMonth"===e.view.type&&(n.data.view="month");var a=this.options.global?this.options.globalCreateUrl:this.options.editUrl;s.global.load(a,n).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){o.fetch()})}).catch(function(e){s.global.close(),t.log.error(e,!0)}),this.fullCalendar.unselect()},d.prototype.fetch=function(){this.fullCalendar.refetchEvents()},d.prototype.updateEvent=function(e){var o=this,n=e.event,i=n.extendedProps,r={data:{id:n.id,start:this.toJsonDateFormat(n.start,n.allDay),end:this.toJsonDateFormat(n.end,n.allDay)}};this.loader(),a.post(i.updateUrl,r).then(function(e){e.success?t.log.success("saved"):t.log.error(e,!0),i.refreshAfterUpdate&&o.fetch()}).catch(function(o){t.log.error(o,!0),e.revert()}).finally(function(){o.loader(!1)})},d.prototype.clickEvent=function(e){var o=e.event.extendedProps;if(o.viewUrl){var n=this;"modal"===o.viewMode?s.global.load(o.viewUrl,{viewContext:"fullCalendar"}).then(function(){s.global.set({backdrop:!0}),s.global.$.one("hidden.bs.modal",function(){n.fetch()})}).catch(function(e){t.log.error(e,!0),s.global.close()}):a.pjax.redirect(o.viewUrl)}},d.prototype.loader=function(t){!1===t?r.reset(o("#calendar-overview-loader")):r.set(o("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},t.export=d});

From 412dd1c3021940772d2ae861e82b732ab6ade785 Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Mon, 16 Dec 2024 20:28:42 +0100
Subject: [PATCH 3/7] use listMonth

---
 resources/js/humhub.calendar.Calendar.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/resources/js/humhub.calendar.Calendar.js b/resources/js/humhub.calendar.Calendar.js
index 2e344d6c..660bd20b 100644
--- a/resources/js/humhub.calendar.Calendar.js
+++ b/resources/js/humhub.calendar.Calendar.js
@@ -171,7 +171,7 @@ humhub.module('calendar.Calendar', function (module, require, $) {
             header: {
                 left: 'prev,next today',
                 center: 'title',
-                right: 'create dayGridMonth,timeGridWeek,timeGridDay,listYear'
+                right: 'create dayGridMonth,timeGridWeek,timeGridDay,listMonth'
             },
             buttonText: buttonText,
             plugins: ['dayGrid', 'timeGrid', 'list', 'interaction', 'bootstrap', 'moment', 'momentTimezone'],
@@ -197,7 +197,7 @@ humhub.module('calendar.Calendar', function (module, require, $) {
                 right: 'today'
             };
             options.footer = {
-                center: 'dayGridMonth,timeGridWeek,timeGridDay,listYear',
+                center: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth',
                 right: 'create'
             };
         }

From 3657b2b3e599872e161233c8ee4b1d8d743444ed Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Mon, 16 Dec 2024 21:19:55 +0100
Subject: [PATCH 4/7] Update humhub.calendar.Calendar.min.js

---
 resources/js/humhub.calendar.Calendar.min.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/resources/js/humhub.calendar.Calendar.min.js b/resources/js/humhub.calendar.Calendar.min.js
index 4b42fb96..84339dff 100644
--- a/resources/js/humhub.calendar.Calendar.min.js
+++ b/resources/js/humhub.calendar.Calendar.min.js
@@ -1 +1 @@
-humhub.module("calendar.Calendar",function(t,e,o){var n=e("ui.widget").Widget,a=e("client"),i=e("util").string,r=e("ui.loader"),l=e("ui.view"),s=e("ui.modal"),d=n.extend();d.prototype.init=function(){var e=this;this.options.events=function(t,n,a){o.ajax({url:e.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:e.options.selectors,filters:e.options.filters,types:e.options.types},success:function(t){n(t)}})},t.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},d.prototype.initCalendarFilter=function(){var t=this;o(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),o(".filterCheckbox").click(function(){"3"==o(this).val()&&o(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==o(this).val()&&o(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),o('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},d.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],o(".selectorCheckbox").each(function(){o(this).prop("checked")&&e.options.selectors.push(o(this).val())}),o(".filterCheckbox").each(function(){o(this).prop("checked")&&e.options.filters.push(o(this).val())}),e.options.types=o('select[name="filterType[]"]').val(),this.initFullCalendar(t)},d.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},d.prototype.getDefaultOptions=function(){var e={};"today"!==t.text("button.today")&&(e.today=t.text("button.today")),"month"!==t.text("button.month")&&(e.month=t.text("button.month")),"week"!==t.text("button.week")&&(e.week=t.text("button.week")),"day"!==t.text("button.day")&&(e.day=t.text("button.day")),"list"!==t.text("button.list")&&(e.list=t.text("button.list"));var n=this,a={customButtons:{create:{click:function(){var e=new Date;e.setHours(e.getHours()+1),e.setMinutes(0,0,0);var o=new Date;o.setHours(o.getHours()+2),o.setMinutes(0,0,0);var a={data:{start:n.toJsonDateFormat(e,!1),end:n.toJsonDateFormat(o,!1),cal:1}},i=n.options.global?n.options.globalCreateUrl:n.options.editUrl;s.global.load(i,a).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){n.fetch()})}).catch(function(e){s.global.close(),t.log.error(e,!0)}),n.fullCalendar.unselect()},bootstrapFontAwesome:"fa-plus"}},header:{left:"prev,next today",center:"title",right:"create dayGridMonth,timeGridWeek,timeGridDay,listYear"},buttonText:e,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:o.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:o.proxy(this.loader,this),eventResize:o.proxy(this.updateEvent,this),eventDrop:o.proxy(this.updateEvent,this),eventClick:o.proxy(this.clickEvent,this),eventRender:o.proxy(this.renderEvent,this)};return l.isSmall()&&(a.header={left:"prev,next",center:"title",right:"today"},a.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listYear",right:"create"}),a},d.prototype.renderEvent=function(t,e){var n=o(e);n.attr({title:n.text()}),t.icon&&i.startsWith(t.icon,"fa-")&&n.find(".fc-content").prepend(o('<i class="fa '+t.icon+'"></i>'))},d.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},d.prototype.select=function(e){var o=this,n={data:{start:this.toJsonDateFormat(e.start,!1),end:this.toJsonDateFormat(e.end,!1),cal:1}};"dayGridMonth"===e.view.type&&(n.data.view="month");var a=this.options.global?this.options.globalCreateUrl:this.options.editUrl;s.global.load(a,n).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){o.fetch()})}).catch(function(e){s.global.close(),t.log.error(e,!0)}),this.fullCalendar.unselect()},d.prototype.fetch=function(){this.fullCalendar.refetchEvents()},d.prototype.updateEvent=function(e){var o=this,n=e.event,i=n.extendedProps,r={data:{id:n.id,start:this.toJsonDateFormat(n.start,n.allDay),end:this.toJsonDateFormat(n.end,n.allDay)}};this.loader(),a.post(i.updateUrl,r).then(function(e){e.success?t.log.success("saved"):t.log.error(e,!0),i.refreshAfterUpdate&&o.fetch()}).catch(function(o){t.log.error(o,!0),e.revert()}).finally(function(){o.loader(!1)})},d.prototype.clickEvent=function(e){var o=e.event.extendedProps;if(o.viewUrl){var n=this;"modal"===o.viewMode?s.global.load(o.viewUrl,{viewContext:"fullCalendar"}).then(function(){s.global.set({backdrop:!0}),s.global.$.one("hidden.bs.modal",function(){n.fetch()})}).catch(function(e){t.log.error(e,!0),s.global.close()}):a.pjax.redirect(o.viewUrl)}},d.prototype.loader=function(t){!1===t?r.reset(o("#calendar-overview-loader")):r.set(o("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},t.export=d});
+humhub.module("calendar.Calendar",function(t,e,o){var n=e("ui.widget").Widget,i=e("client"),a=e("util").string,r=e("ui.loader"),l=e("ui.view"),s=e("ui.modal"),d=n.extend();d.prototype.init=function(){var e=this;this.options.events=function(t,n,i){o.ajax({url:e.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:e.options.selectors,filters:e.options.filters,types:e.options.types},success:function(t){n(t)}})},t.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},d.prototype.initCalendarFilter=function(){var t=this;o(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),o(".filterCheckbox").click(function(){"3"==o(this).val()&&o(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==o(this).val()&&o(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),o('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},d.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],o(".selectorCheckbox").each(function(){o(this).prop("checked")&&e.options.selectors.push(o(this).val())}),o(".filterCheckbox").each(function(){o(this).prop("checked")&&e.options.filters.push(o(this).val())}),e.options.types=o('select[name="filterType[]"]').val(),this.initFullCalendar(t)},d.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},d.prototype.getDefaultOptions=function(){var e={};"today"!==t.text("button.today")&&(e.today=t.text("button.today")),"month"!==t.text("button.month")&&(e.month=t.text("button.month")),"week"!==t.text("button.week")&&(e.week=t.text("button.week")),"day"!==t.text("button.day")&&(e.day=t.text("button.day")),"list"!==t.text("button.list")&&(e.list=t.text("button.list"));var n=this,i={customButtons:{create:{click:function(){var e=new Date;e.setHours(e.getHours()+1),e.setMinutes(0,0,0);var o=new Date;o.setHours(o.getHours()+2),o.setMinutes(0,0,0);var i={data:{start:n.toJsonDateFormat(e,!1),end:n.toJsonDateFormat(o,!1),cal:1}},a=n.options.global?n.options.globalCreateUrl:n.options.editUrl;s.global.load(a,i).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){n.fetch()})}).catch(function(e){s.global.close(),t.log.error(e,!0)}),n.fullCalendar.unselect()},bootstrapFontAwesome:"fa-plus"}},header:{left:"prev,next today",center:"title",right:"create dayGridMonth,timeGridWeek,timeGridDay,listMonth"},buttonText:e,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:o.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:o.proxy(this.loader,this),eventResize:o.proxy(this.updateEvent,this),eventDrop:o.proxy(this.updateEvent,this),eventClick:o.proxy(this.clickEvent,this),eventRender:o.proxy(this.renderEvent,this)};return l.isSmall()&&(i.header={left:"prev,next",center:"title",right:"today"},i.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listMonth",right:"create"}),i},d.prototype.renderEvent=function(t,e){var n=o(e);n.attr({title:n.text()}),t.icon&&a.startsWith(t.icon,"fa-")&&n.find(".fc-content").prepend(o('<i class="fa '+t.icon+'"></i>'))},d.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},d.prototype.select=function(e){var o=this,n={data:{start:this.toJsonDateFormat(e.start,!1),end:this.toJsonDateFormat(e.end,!1),cal:1}};"dayGridMonth"===e.view.type&&(n.data.view="month");var i=this.options.global?this.options.globalCreateUrl:this.options.editUrl;s.global.load(i,n).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){o.fetch()})}).catch(function(e){s.global.close(),t.log.error(e,!0)}),this.fullCalendar.unselect()},d.prototype.fetch=function(){this.fullCalendar.refetchEvents()},d.prototype.updateEvent=function(e){var o=this,n=e.event,a=n.extendedProps,r={data:{id:n.id,start:this.toJsonDateFormat(n.start,n.allDay),end:this.toJsonDateFormat(n.end,n.allDay)}};this.loader(),i.post(a.updateUrl,r).then(function(e){e.success?t.log.success("saved"):t.log.error(e,!0),a.refreshAfterUpdate&&o.fetch()}).catch(function(o){t.log.error(o,!0),e.revert()}).finally(function(){o.loader(!1)})},d.prototype.clickEvent=function(e){var o=e.event.extendedProps;if(o.viewUrl){var n=this;"modal"===o.viewMode?s.global.load(o.viewUrl,{viewContext:"fullCalendar"}).then(function(){s.global.set({backdrop:!0}),s.global.$.one("hidden.bs.modal",function(){n.fetch()})}).catch(function(e){t.log.error(e,!0),s.global.close()}):i.pjax.redirect(o.viewUrl)}},d.prototype.loader=function(t){!1===t?r.reset(o("#calendar-overview-loader")):r.set(o("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},t.export=d});
\ No newline at end of file

From 036bae169a50ad556b012b8287d8e913dfd56836 Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Mon, 16 Dec 2024 21:37:11 +0100
Subject: [PATCH 5/7] Replace listWeek and listYear with listMonth

---
 models/participation/FullCalendarSettings.php | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/models/participation/FullCalendarSettings.php b/models/participation/FullCalendarSettings.php
index a375fde6..15aadc9a 100644
--- a/models/participation/FullCalendarSettings.php
+++ b/models/participation/FullCalendarSettings.php
@@ -10,11 +10,10 @@
 
 class FullCalendarSettings extends Model
 {
-    public const SETTING_LIST_WEEK = 'listWeek';
     public const SETTING_GRID_DAY = 'timeGridDay';
     public const SETTING_GRID_WEEK = 'timeGridWeek';
     public const SETTING_GRID_MONTH = 'dayGridMonth';
-    public const SETTING_LIST_YEAR = 'listYear';
+    public const SETTING_LIST_MONTH = 'listMonth';
     public const SETTING_VIEW_MODE_KEY = 'defaults.fullCalendarViewMode';
 
     /**
@@ -42,6 +41,11 @@ public function init()
     private function initSettings()
     {
         $this->viewMode = $this->getSetting(self::SETTING_VIEW_MODE_KEY, static::SETTING_GRID_MONTH);
+        
+        // Handle removed view modes
+        if ($this->viewMode === 'listWeek' || $this->viewMode === 'listYear') {
+            $this->viewMode = 'listMonth';
+        }
     }
 
     /**
@@ -110,11 +114,10 @@ public function isGlobal()
     public function getViewModeItems()
     {
         return [
-            self::SETTING_LIST_YEAR => Yii::t('CalendarModule.base', 'Year'),
             self::SETTING_GRID_MONTH => Yii::t('CalendarModule.base', 'Month'),
             self::SETTING_GRID_WEEK => Yii::t('CalendarModule.base', 'Week'),
             self::SETTING_GRID_DAY => Yii::t('CalendarModule.base', 'Day'),
-            self::SETTING_LIST_WEEK => Yii::t('CalendarModule.base', 'List'),
+            self::SETTING_LIST_MONTH => Yii::t('CalendarModule.base', 'List'),
         ];
     }
 }

From d478dbfe162860bdef800ad499dc6c63b8672a8d Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Mon, 16 Dec 2024 21:45:46 +0100
Subject: [PATCH 6/7] Update humhub.calendar.Calendar.js

---
 resources/js/humhub.calendar.Calendar.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/resources/js/humhub.calendar.Calendar.js b/resources/js/humhub.calendar.Calendar.js
index 660bd20b..a7b5f86c 100644
--- a/resources/js/humhub.calendar.Calendar.js
+++ b/resources/js/humhub.calendar.Calendar.js
@@ -328,4 +328,4 @@ humhub.module('calendar.Calendar', function (module, require, $) {
     };
 
     module.export = Calendar;
-});
+});
\ No newline at end of file

From 6c6232e81ea0ae949625575903bc60699b6735cf Mon Sep 17 00:00:00 2001
From: Felix Hahn <info@hahn-felix.de>
Date: Tue, 28 Jan 2025 14:03:12 +0100
Subject: [PATCH 7/7] Update CHANGELOG.md

---
 docs/CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 39ab967d..02038304 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -5,6 +5,7 @@ Changelog
 -----------------------
 - Fix #509: Fix event type visibility
 - Enh #512: Surround the widget wall entry links with a dedicated HTML class
+- Enh #514: Replace the view modes listWeek and listYear with listMonth
 
 1.6.4 (Unreleased)
 -----------------------