From 75ab1437c5032b15d55ab36b1a4f777e044bd9f1 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 24 May 2012 15:52:34 +0800 Subject: [PATCH] DataObjects/Core_notify_recur.php --- DataObjects/Core_notify_recur.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/DataObjects/Core_notify_recur.php b/DataObjects/Core_notify_recur.php index 165ad944..1dc5bb40 100644 --- a/DataObjects/Core_notify_recur.php +++ b/DataObjects/Core_notify_recur.php @@ -70,18 +70,22 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject $days = json_decode($this->freq_day); //print_r($days); - for ($day = date('Y-m-d', strtotime($start));strtotime($day) < strtotime($end); $day = date('Y-m-d', strtotime("$day + 1 DAY"))){ - print_r($day); - // skip days not accounted for.. - if (!in_array(date('N', strtotime($day)), $days)) { - continue; - } - foreach($hours as $h) { - $hh = strpos($h,":") > 0 ? $h : "$H:00"; - $ret[] = $day . ' ' . $hh; - } + foreach($days as $d){ + $ret[] = date('Y-m-d', strtotime($d)) . ' ' . $hours; + print_r($ret); } - return $this->applyTimezoneToList($ret); +// for ($day = date('Y-m-d', strtotime($start)); strtotime($day) < strtotime($end); $day = date('Y-m-d', strtotime("$day + 1 DAY"))){ +// print_r($day); +// // skip days not accounted for.. +// if (!in_array(date('N', strtotime($day)), $days)) { +// continue; +// } +// foreach($hours as $h) { +// $hh = strpos($h,":") > 0 ? $h : "$H:00"; +// $ret[] = $day . ' ' . $hh; +// } +// } +// return $this->applyTimezoneToList($ret); // if($this->freq_hour){ // // happens every day based on freq_hour. -- 2.39.2