]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: New function getLastDaysIntervals() in CTimeUtils class
authorDavide Franco <bacula-dev@dflc.ch>
Sat, 9 Jul 2011 15:00:30 +0000 (17:00 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:22 +0000 (14:49 +0200)
gui/bacula-web/includes/utils/ctimeutils.class.php

index 594d1d7f33b39cc8734f4ed6de59e324de8b7ab1..381148fff4510d154fd31a788299e5156c356d18 100644 (file)
@@ -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;
+       }
 }
 
 ?>