diff --git a/module/metric/calc.class.php b/module/metric/calc.class.php index aeab8ae893..997c32105f 100644 --- a/module/metric/calc.class.php +++ b/module/metric/calc.class.php @@ -297,7 +297,7 @@ class baseCalc if(strlen($dateStr) > 10) $dateStr = substr($dateStr, 0, 10); $date = DateTime::createFromFormat('Y-m-d', $dateStr); - return $date->format('W'); + return substr($date->format('oW'), -2); } /** diff --git a/module/metric/model.php b/module/metric/model.php index eb585077d5..4cce26b098 100755 --- a/module/metric/model.php +++ b/module/metric/model.php @@ -1914,6 +1914,7 @@ class metricModel extends model $month = date('m', $timestamp); $day = date('d', $timestamp); $week = date('oW', $timestamp); + $week = substr($week, -2); $dateValues = new stdClass(); diff --git a/module/metric/zen.php b/module/metric/zen.php index f37a29be52..f788e07678 100644 --- a/module/metric/zen.php +++ b/module/metric/zen.php @@ -179,7 +179,7 @@ class metricZen extends metric */ protected function prepareMetricRecord($calcList) { - $options = array('year' => date('Y'), 'month' => date('n'), 'week' => date('W'), 'day' => date('j')); + $options = array('year' => date('Y'), 'month' => date('n'), 'week' => substr(date('oW'), -2), 'day' => date('j')); $now = helper::now(); $dateValues = $this->metric->generateDateValues($now);