summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsten <stenmarsh938@gmail.com>2016-03-21 12:51:04 +0300
committersten <stenmarsh938@gmail.com>2016-03-21 12:51:04 +0300
commit637681f53e307e8b03a4e03265a3f7bd59ba31af (patch)
tree851781f80a71fb882f83b4d5f3ffedb5a5409aa9
parent3ec15ffe2273acf2820df11203dc4ab06614d15b (diff)
parentfd8ef5ec711dd1d66b2836448bf26e885ec2c3e4 (diff)
downloadscheduler-helper-php-637681f53e307e8b03a4e03265a3f7bd59ba31af.zip
scheduler-helper-php-637681f53e307e8b03a4e03265a3f7bd59ba31af.tar.gz
scheduler-helper-php-637681f53e307e8b03a4e03265a3f7bd59ba31af.tar.bz2
Merge branch 'master' into helperTests
-rw-r--r--RecurringType.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/RecurringType.php b/RecurringType.php
index 4408dbb..96e36d4 100644
--- a/RecurringType.php
+++ b/RecurringType.php
@@ -112,9 +112,14 @@ class RecurringType {
case $dataFields[self::FLD_WEEK_DAYS_LIST]:
$weekDaysToRecurring = explode(",", $value);
$days = array();
+ $repeatVal = str_replace(" ", "", $dataArray[$dataFields[self::FLD_REC_TYPE]]);
+ if($repeatVal == "year"){
+ $daysOfWeek["sunday"] = 7;
+ }
+
foreach($weekDaysToRecurring as $day) {
$day = str_replace(" ", "", $day);
- if(!in_array($day, $daysOfWeek))
+ if(!isset($daysOfWeek[$day]))
throw new Exception("Field {$field} will contains data like 'monday,tuesday,wednesday'.");
array_push($days, $daysOfWeek[$day]);