summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2010-08-17 18:14:30 +0200
committersmos <seth.mos@dds.nl>2010-08-17 18:14:30 +0200
commita0bd34173cc158b010a4dc7be988f823ca7c180b (patch)
tree4a372b676b7024accf36e68ee4a71782904d48fb
parent17649c8793796bd52a559c0e1d3709235a86c1ae (diff)
downloadpfsense-a0bd34173cc158b010a4dc7be988f823ca7c180b.zip
pfsense-a0bd34173cc158b010a4dc7be988f823ca7c180b.tar.gz
Do not show the empty part of the graph by request of many
-rwxr-xr-xusr/local/www/status_rrd_graph.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 28e6220..14dc30d 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -227,11 +227,13 @@ function get_dates($curperiod, $graph) {
break;
}
$start = mktime((8 + $houroffset), 0, 0, $curmonth, $curday, $curyear);
- $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear);
+ if($offset == 0)
+ $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear);
break;
case "day":
$start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear);
- $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
break;
case "week":
switch($offset) {
@@ -243,23 +245,28 @@ function get_dates($curperiod, $graph) {
break;
}
$start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear);
- $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
break;
case "month":
$start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear);
- $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
break;
case "quarter":
$start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear);
- $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
break;
case "year":
$start = mktime(0, 0, 0, 1, 0, ($curyear + $offset));
- $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
+ if($offset == 0)
+ $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
break;
case "4year":
$start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset));
- $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
+ if($offset == 0)
+ $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
break;
}
// echo "start $start ". date('l jS \of F Y h:i:s A', $start) .", end $end ". date('l jS \of F Y h:i:s A', $end) ."<br>";
OpenPOWER on IntegriCloud