From 1febd32a765c2e04104dad07c3fdffb7950365f1 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 1 Mar 2012 16:32:31 -0800 Subject: [PATCH] Don't hide columns with stats from previous age, hide columns with no data Summary: This does two things: - don't fill '-' for columns where there are data from previous week - completele hide columns if there are now new data so that noobs don't have a 55 years of history Test Plan: View my commits stats. View my requested changes stats. View epriestley FB stats. Reviewers: vii, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1750 --- .../view/revisionstats/DifferentialRevisionStatsView.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/applications/differential/view/revisionstats/DifferentialRevisionStatsView.php b/src/applications/differential/view/revisionstats/DifferentialRevisionStatsView.php index 27c7fdda78..4d8aaae49e 100644 --- a/src/applications/differential/view/revisionstats/DifferentialRevisionStatsView.php +++ b/src/applications/differential/view/revisionstats/DifferentialRevisionStatsView.php @@ -101,10 +101,12 @@ final class DifferentialRevisionStatsView extends AphrontView { } $old_count = 0; - foreach ($dates as $age => $cutoff) { + foreach (array_reverse($dates) as $age => $cutoff) { $weeks = ($now - $cutoff + 0.) / (7 * 60 * 60 * 24); - if ($old_count == $counts[$age]) { - continue; + if ($old_count == $counts[$age] && count($row_array) == 1) { + end($row_array); + unset($dates[key($row_array)]); + $row_array = array(); } $old_count = $counts[$age];