* Fix generate zero metric record of week.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user