summaryrefslogtreecommitdiffstats
path: root/3rdparty
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-01-08 16:41:36 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-01-08 16:41:36 +0100
commita9aabd1c8d8acce429a66779d1fe69025a317a83 (patch)
tree06c302a16d8908a61d7e8dcd8c48e3d62bb72358 /3rdparty
parentc3cda81577a396960fa69b651f27bad2828e0c30 (diff)
downloadnextcloud-server-a9aabd1c8d8acce429a66779d1fe69025a317a83.tar.gz
nextcloud-server-a9aabd1c8d8acce429a66779d1fe69025a317a83.zip
3rdparty: fix bug in when
Diffstat (limited to '3rdparty')
-rwxr-xr-x3rdparty/when/When.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/3rdparty/when/When.php b/3rdparty/when/When.php
index f8bb9db0f67..5eaf3dec69d 100755
--- a/3rdparty/when/When.php
+++ b/3rdparty/when/When.php
@@ -621,7 +621,19 @@ class When
if($interval == "month")
{
- $this->try_date->modify('+1 month');
+
+ $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');
+ }
+ //$this->try_date->setDate(date('y/n/j', mktime(0,0,0,$this->try_date->format('j'), $this->try_date->format('n') + 1, $year = $this->try_date->format('Y'))));
+ //echo date('t', $this->try_date->format('U')) . '-' . $this->try_date->format('U') . ' ';
+ /*$month_day = $this->try_date->format('j');
+ $month = $this->try_date->format('n');
+ $year = $this->try_date->format('Y');*/
+
}
else
{