]> source.dussan.org Git - nextcloud-server.git/commitdiff
3rdparty: fix bug in when
authorGeorg Ehrke <dev@georgswebsite.de>
Sun, 8 Jan 2012 15:41:36 +0000 (16:41 +0100)
committerGeorg Ehrke <dev@georgswebsite.de>
Sun, 8 Jan 2012 15:41:36 +0000 (16:41 +0100)
3rdparty/when/When.php

index f8bb9db0f670e94f117db12e9a48329233534863..5eaf3dec69d58eb1d8f86833f6c892c2f3f14716 100755 (executable)
@@ -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
                {