diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-17 05:29:48 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-17 05:29:48 +0300 |
commit | ffe13e3b2cfe460278a4a7571fee15363d213e9e (patch) | |
tree | 501b82722b07a4e30de086d61d8ea9f91bbed0db /plugins/Actions | |
parent | 85980f0210972b65cbf7523a9afba44c776f4791 (diff) |
Only use '-' as formatted average page generation time if formatting for HTML (for backwards compatibility).
Diffstat (limited to 'plugins/Actions')
-rw-r--r-- | plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php b/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php index cf8ea3018d..f7df68aaaa 100644 --- a/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php +++ b/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php @@ -50,7 +50,13 @@ class AveragePageGenerationTime extends ProcessedMetric public function format($value, Formatter $formatter) { - return $value ? $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true) : "-"; + if ($formatter instanceof Formatter\Html + && !$value + ) { + return '-'; + } else { + return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true); + } } public function beforeCompute($report, DataTable $table) |