summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-27 16:44:17 +0200
committerSebastian Wagner2011-10-27 16:44:17 +0200
commitdee022bf154542c2c920c17ef84e14e3f4cfa5cc (patch)
tree9b3f00d06562201a4ac6ac5ae96639e11c1de2f2
parentshutdown force fix (diff)
downloadpoolctrl-dee022bf154542c2c920c17ef84e14e3f4cfa5cc.tar.gz
poolctrl-dee022bf154542c2c920c17ef84e14e3f4cfa5cc.tar.xz
poolctrl-dee022bf154542c2c920c17ef84e14e3f4cfa5cc.zip
summertime fix
-rwxr-xr-xapplication/controllers/EventController.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 579dc28..c025118 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -694,6 +694,18 @@ class EventController extends Zend_Controller_Action
}
$enewstart = date('Y-m-d H:i:s', strtotime($e['start']) + $diff);
+ $summertimeStart = intval(date('I', strtotime($e['start'])));
+ if($summertimeStart) {
+ if(!date('I', strtotime($enewstart))) {
+ $enewstart = date('Y-m-d H:i:s', strtotime($enewstart) + 60 * 60);
+ $summertimeStart = 0;
+ }
+ } else {
+ if(date('I', strtotime($enewstart))) {
+ $enewstart = date('Y-m-d H:i:s', strtotime($enewstart) - 60 * 60);
+ $summertimeStart = 1;
+ }
+ }
if(!isset($e['end'])) {
$e['end'] = date('Y-m-d H:i:s', strtotime($e['start']) + 300);
$e['endSet'] = true;
@@ -701,6 +713,18 @@ class EventController extends Zend_Controller_Action
$e['endSet'] = false;
}
$enewend = date('Y-m-d H:i:s', strtotime($e['end']) + $diff);
+ $summertimeEnd = intval(date('I', strtotime($e['start'])));
+ if($summertimeEnd) {
+ if(!date('I', strtotime($enewend))) {
+ $enewend = date('Y-m-d H:i:s', strtotime($enewend) + 60 * 60);
+ $summertimeEnd = 0;
+ }
+ } else {
+ if(date('I', strtotime($enewend))) {
+ $enewend = date('Y-m-d H:i:s', strtotime($enewend) - 60 * 60);
+ $summertimeEnd = 1;
+ }
+ }
$cfv = true;
$event = new Application_Model_Event($e);
$event->setID($e['eventID']);
@@ -856,6 +880,19 @@ class EventController extends Zend_Controller_Action
$event->setID($e['eventID']);
$enewstart = date('Y-m-d H:i:s', strtotime($e['start']));
$enewend = date('Y-m-d H:i:s', strtotime($e['end']) + $diffDelta);
+ $summertimeEnd = intval(date('I', strtotime($e['start'])));
+ if($summertimeEnd) {
+ if(!date('I', strtotime($enewend))) {
+ $enewend = date('Y-m-d H:i:s', strtotime($enewend) + 60 * 60);
+ $summertimeEnd = 0;
+ }
+ } else {
+ if(date('I', strtotime($enewend))) {
+ $enewend = date('Y-m-d H:i:s', strotitime($enewend) - 60 * 60);
+ $summertimeEnd = 1;
+ }
+ }
+
$cfv = true;
// overlap events