From 0d929718204424c2c2ed64ae86758f4e904d5275 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Sat, 9 Jul 2011 17:00:30 +0200 Subject: [PATCH] bacula-web: New function getLastDaysIntervals() in CTimeUtils class --- gui/bacula-web/includes/utils/ctimeutils.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; + } } ?> -- 2.39.5