summaryrefslogtreecommitdiffstats
path: root/3rdparty
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-06-09 15:14:49 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-06-09 15:15:00 +0200
commit531132d64f7eab2e5f175164b0b0c6d322145d10 (patch)
tree79d2e82ee6bb561207710d23bb3e4312edd565ed /3rdparty
parentcfb9c764ca06ad431925aaa4dcf8dc35ed3fb394 (diff)
downloadnextcloud-server-531132d64f7eab2e5f175164b0b0c6d322145d10.tar.gz
nextcloud-server-531132d64f7eab2e5f175164b0b0c6d322145d10.zip
fix a bug in when
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/when/When.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/3rdparty/when/When.php b/3rdparty/when/When.php
index 5f97f0eb9bf..185836bf0c5 100644
--- a/3rdparty/when/When.php
+++ b/3rdparty/when/When.php
@@ -586,7 +586,7 @@ class When
}
}
}
- elseif($this->gobyday || $interval == "month")
+ elseif($this->gobyday && $interval == "month")
{
$_mdays = range(1, date('t',mktime(0,0,0,$month,1,$year)));
foreach($_mdays as $_mday)
@@ -621,7 +621,13 @@ class When
if($interval == "month")
{
- $this->try_date->modify('last day of ' . $this->interval . ' ' . $interval);
+
+ $this->try_date->modify('first day of next month');
+ if((int) date('t', $this->try_date->format('U')) > (int) $this->start_date->format('j')){
+ $this->try_date->modify('+' . (int) $this->start_date->format('j') - 1 . ' day');
+ }else{
+ $this->try_date->modify('+' . (int) date('t', $this->try_date->format('U')) - 1 . ' day');
+ }
}
else
{
@@ -722,4 +728,4 @@ class When
}
}
}
-}
+} \ No newline at end of file