diff options
author | smos <seth.mos@dds.nl> | 2010-07-15 20:33:02 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2010-07-15 20:33:02 +0200 |
commit | 6a8cf738d6fc852773a9049c6728453ad5dbca9f (patch) | |
tree | 76f336e45035087bc56a17e540fd570c8ee4fd9b /usr/local | |
parent | 161cd05c63acb5c200adf65572cad2db2a259a61 (diff) | |
download | pfsense-6a8cf738d6fc852773a9049c6728453ad5dbca9f.zip pfsense-6a8cf738d6fc852773a9049c6728453ad5dbca9f.tar.gz |
Fix the calculus so the date goes backwards
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 441aa3a..b467d8a 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -180,30 +180,31 @@ function get_dates($curperiod, $graph) { } switch($graph) { case "day": - $start = mktime(0, 0, 0, $curmonth, ($curday - $offset), $curyear); - $end = mktime(0, 0, 0, $curmonth, (($curday - $offset) + 1), $curyear); + $start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear); + $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); break; case "week": - $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) - $offset), $curyear); - $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + 7), $curyear); + $start = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) - $offset), $curyear); + $end = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) + 7), $curyear); break; case "month": - $start = mktime(0, 0, 0, ($curmonth - $offset), 0, $curyear); - $end = mktime(0, 0, 0, (($curmonth - $offset) + 1), 0, $curyear); + $start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear); + $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); + $start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear); + $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, 1, (($curyear - $offset) +1)); + $start = mktime(0, 0, 0, 1, 0, ($curyear + $offset)); + $end = mktime(0, 0, 0, 1, 1, (($curyear + $offset) +1)); break; - case "4year": - $start = mktime(0, 0, 0, 1, 0, (($curyear - 3) - $offset)); - $end = mktime(0, 0, 0, 1, 1, (($curyear - $offset) +1)); + case "4year": + $start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset)); + $end = mktime(0, 0, 0, 1, 1, (($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>"; $dates = array(); $dates['start'] = $start; $dates['end'] = $end; |