From: Davide Franco Date: Sat, 9 Jul 2011 15:00:30 +0000 (+0200) Subject: bacula-web: New function getLastDaysIntervals() in CTimeUtils class X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d929718204424c2c2ed64ae86758f4e904d5275;p=bacula%2Fbacula bacula-web: New function getLastDaysIntervals() in CTimeUtils class --- diff --git a/gui/bacula-web/includes/utils/ctimeutils.class.php b/gui/bacula-web/includes/utils/ctimeutils.class.php index 594d1d7f33..381148fff4 100644 --- a/gui/bacula-web/includes/utils/ctimeutils.class.php +++ b/gui/bacula-web/includes/utils/ctimeutils.class.php @@ -56,6 +56,17 @@ class CTimeUtils { return array( 'start' => $start, 'end' => $end); } + + static public function getLastDaysIntervals( $nb_days ) + { + $days = array(); + + for( $d = $nb_days ; $d >= 0 ; $d-- ) { + $today = NOW - ($d * DAY); + $days[] = self::get_Day_Intervals($today); + } + return $days; + } } ?>