From 4d74df2b87654c18431c33c9dba26aa71bf2b4f3 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 6 Jan 2017 14:48:13 +0100 Subject: [PATCH] * Calendar/Categrory report: Fix miscalculation of multidays events because of wrong week number --- calendar/inc/class.calendar_category_report.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_category_report.inc.php b/calendar/inc/class.calendar_category_report.inc.php index 6a402f9f38..a7ce0a980b 100644 --- a/calendar/inc/class.calendar_category_report.inc.php +++ b/calendar/inc/class.calendar_category_report.inc.php @@ -107,8 +107,8 @@ class calendar_category_report extends calendar_ui{ $day_timestamp = strtotime($day_index); // week number - $week_number = date('W', $day_timestamp); - + $week_number = ltrim(date('W', $day_timestamp), '0'); + $previous_week_number = $week_number == 1? ($events_log[$user_id]['53']? 53: 52): $week_number -1; // check if multidays event starts before start range $is_over_range_event = $day_timestamp< $event['end'] && $start_range > $event['start'];