DataObjects/Core_notify_recur.php
authorAlan Knowles <alan@akbkhome.com>
Tue, 3 Apr 2012 09:43:30 +0000 (17:43 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 3 Apr 2012 09:43:30 +0000 (17:43 +0800)
DataObjects/Core_notify_recur.php

index 88a27a6..6c1349e 100644 (file)
@@ -57,16 +57,26 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject
         switch($this->freq) {
             case 'HOURLY':
                 
-                $days = 
+                
+                
                 // happens every day based on freq_hour.
                 $hours = explode(',', $this->freq_hour);
-                foreach($hours as $h) {
-                    
+                for ($day = date('Y-m-d', strtotime($start));
+                        strtotime($day) < strtotime($end);
+                        $day = date('Y-m-d', strtotime("$day + 1 DAY")))
+                {
+                    foreach($hours as $h) {
+                        $hh = strpos($h,":") > 0 ? $h : "$H:00";
+                        $ret[] = $day . ' ' . $hh;
+                    }
                 }
+                return $this->applyTimezoneToList($ret);
                 
             case 'DAILY':
                 
                 
+                
+                
             case 'MONTHLY': // ignored..
             case 'YEARLY': // ignored..
                 break;