From 7e17983c9e25aa29e4bb0500b3ff9a963a978b8a Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Mon, 30 Dec 2024 08:43:54 +0100 Subject: [PATCH] Zeiterfassung Bugfix: * PHP Date statt Y o genommen damit die Kalenderwoche sich auf das richtige Jahr bezieht --- Layout/default/Timerecording/Index.php | 2 +- application/Timerecording/TimerecordingController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Layout/default/Timerecording/Index.php b/Layout/default/Timerecording/Index.php index 3d3eefab8..d4bbd8b9c 100644 --- a/Layout/default/Timerecording/Index.php +++ b/Layout/default/Timerecording/Index.php @@ -15,7 +15,7 @@ $monthger[12] = "Dezember"; $time = time(); for ($i = 1; $i <= 25; $i++) { $kw = date('W', $time); - $year = date('Y', $time); + $year = date('o', $time); $timestamp_montag = strtotime("{$year}-W{$kw}"); $timestamp_freitag = strtotime("{$year}-W{$kw}-7"); $weeks[$time] = "KW" . $kw . " " . $year . " (" . date('d.m', $timestamp_montag) . "-" . date('d.m', $timestamp_freitag) . ")"; diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index b785362c2..e28d7a9ac 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -687,7 +687,7 @@ class TimerecordingController extends mfBaseController if ($datatype == 1) { $kw = date('W', $dataweek); - $year = date('Y', $dataweek); + $year = date('o', $dataweek); $timestamp_montag = strtotime("{$year}-W{$kw}"); $timestamp_sonntag = strtotime("{$year}-W{$kw}-7"); $firstdate = strtotime(date("Y-m-d", $timestamp_montag) . " 00:00:00"); @@ -1068,7 +1068,7 @@ class TimerecordingController extends mfBaseController $kw = date('W', $dataweek); - $year = date('Y', $dataweek); + $year = date('o', $dataweek); $timestamp_montag = strtotime("{$year}-W{$kw}"); $timestamp_sonntag = strtotime("{$year}-W{$kw}-7"); $firstdate = strtotime(date("Y-m-d", $timestamp_montag) . " 00:00:00");