[Pkg-owncloud-commits] [php-sabre-vobject] 13/43: Super ugly fix.

David Prévot taffit at moszumanska.debian.org
Fri Oct 10 14:16:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit bd1fbf887f2ada047b2c58b1588061fe6033092d
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Fri Sep 26 14:44:48 2014 +0100

    Super ugly fix.
---
 lib/ITip/Broker.php                            | 16 ++++++++++++++--
 tests/VObject/ITip/BrokerAttendeeReplyTest.php |  8 ++++----
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index c96ee31..54a334a 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -731,13 +731,25 @@ class Broker {
                     $event->add('SUMMARY', $summary);
                 }
             } else {
-                $event->add('DTSTART', DateTimeParser::parseDateTime($instance['id'], $eventInfo['timezone']));
+                $dt = DateTimeParser::parse($instance['id'], $eventInfo['timezone']);
+                // Treat is as a DATE field
+                if (strlen($instance['id']) <= 8) {
+                    $recur = $event->add('DTSTART', $dt, array('VALUE' => 'DATE'));
+                } else {
+                    $recur = $event->add('DTSTART', $dt);
+                }
                 if ($summary) {
                     $event->add('SUMMARY', $summary);
                 }
             }
             if ($instance['id'] !== 'master') {
-                $event->{'RECURRENCE-ID'} = DateTimeParser::parseDateTime($instance['id'], $eventInfo['timezone']);
+                $dt = DateTimeParser::parse($instance['id'], $eventInfo['timezone']);
+                // Treat is as a DATE field
+                if (strlen($instance['id']) <= 8) {
+                    $recur = $event->add('RECURRENCE-ID', $dt, array('VALUE' => 'DATE'));
+                } else {
+                    $recur = $event->add('RECURRENCE-ID', $dt);
+                }
             }
             $organizer = $event->add('ORGANIZER', $message->recipient);
             if ($message->recipientName) {
diff --git a/tests/VObject/ITip/BrokerAttendeeReplyTest.php b/tests/VObject/ITip/BrokerAttendeeReplyTest.php
index 7210d7c..daa9666 100644
--- a/tests/VObject/ITip/BrokerAttendeeReplyTest.php
+++ b/tests/VObject/ITip/BrokerAttendeeReplyTest.php
@@ -336,13 +336,13 @@ END:VEVENT
 END:VCALENDAR
 ICS
 
-        ),
+            ),
 
-    );
+        );
 
-    $result = $this->parse($oldMessage, $newMessage, $expected);
+        $result = $this->parse($oldMessage, $newMessage, $expected);
 
-}
+    }
 
     function testNoChange() {
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list