From 8a163bf036ed16e41665c908a6d2526fe05b84b7 Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Mon, 25 Mar 2024 14:35:05 +0000
Subject: [PATCH] calendar: added date information in center area of the
 fullcalendar header, fixes #3879

Closes #3879

Merge request studip/studip!2736
---
 app/controllers/calendar/calendar.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php
index 9b5aab0e802..609a0b6797f 100644
--- a/app/controllers/calendar/calendar.php
+++ b/app/controllers/calendar/calendar.php
@@ -349,21 +349,25 @@ class Calendar_CalendarController extends AuthenticatedController
                             ? 'resourceTimelineWeek,resourceTimelineDay'
                             : 'dayGridYear,dayGridMonth,timeGridWeek,timeGridDay'
                     ),
+                    'center'  => 'title',
                     'right'  => 'prev,today,next'
                 ],
                 'weekNumbers' => true,
                 'views' => [
                     'dayGridMonth' => [
                         'eventTimeFormat' => ['hour' => 'numeric', 'minute' => '2-digit'],
+                        'titleFormat'     => ['year' => 'numeric', 'month' => 'long'],
                         'displayEventEnd' => true
                     ],
                     'timeGridWeek' => [
                         'columnHeaderFormat' => ['weekday' => 'short', 'year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit', 'omitCommas' => true],
                         'weekends'           => $calendar_settings['type_week'] === 'LONG',
+                        'titleFormat'        => ['year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit'],
                         'slotDuration'       => $slot_durations['week']
                     ],
                     'timeGridDay' => [
                         'columnHeaderFormat' => ['weekday' => 'long', 'year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit', 'omitCommas' => true],
+                        'titleFormat'        => ['year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit'],
                         'slotDuration'       => $slot_durations['day']
                     ],
                     'resourceTimelineWeek' => [
@@ -470,21 +474,25 @@ class Calendar_CalendarController extends AuthenticatedController
                 'allDayText'  => '',
                 'header'      => [
                     'left'    => 'dayGridYear,dayGridMonth,timeGridWeek,timeGridDay',
+                    'center'  => 'title',
                     'right'   => 'prev,today,next'
                 ],
                 'weekNumbers' => true,
                 'views'       => [
                     'dayGridMonth' => [
                         'eventTimeFormat' => ['hour' => 'numeric', 'minute' => '2-digit'],
+                        'titleFormat'     => ['year' => 'numeric', 'month' => 'long'],
                         'displayEventEnd' => true
                     ],
                     'timeGridWeek' => [
                         'columnHeaderFormat' => [ 'weekday' => 'short', 'year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit', 'omitCommas' => true ],
                         'weekends'           => $calendar_settings['type_week'] === 'LONG',
+                        'titleFormat'        => ['year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit'],
                         'slotDuration'       => $slot_settings['week']
                     ],
                     'timeGridDay'  => [
                         'columnHeaderFormat' => [ 'weekday' => 'long', 'year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit', 'omitCommas' => true ],
+                        'titleFormat'        => ['year' => 'numeric', 'month' => '2-digit', 'day' => '2-digit'],
                         'slotDuration'       => $slot_settings['day']
                     ]
                 ],
-- 
GitLab