[Pkg-owncloud-commits] [php-sabre-vobject] 12/43: Timezone is now no longer needed

David Prévot taffit at moszumanska.debian.org
Sat Sep 5 15:23:48 UTC 2015


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

taffit pushed a commit to tag 4.0.0-alpha2
in repository php-sabre-vobject.

commit b9c364f28cfbdef14c68b15236c8840c4763f005
Author: Dominik Tobschall <dominik at fruux.com>
Date:   Mon Jul 20 20:45:59 2015 +0200

    Timezone is now no longer needed
---
 lib/BirthdayCalendarGenerator.php | 38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/lib/BirthdayCalendarGenerator.php b/lib/BirthdayCalendarGenerator.php
index 292d624..97057bf 100644
--- a/lib/BirthdayCalendarGenerator.php
+++ b/lib/BirthdayCalendarGenerator.php
@@ -2,7 +2,6 @@
 
 namespace Sabre\VObject;
 
-use DateTimezone;
 use Sabre\VObject\Component\VCalendar;
 
 /**
@@ -22,21 +21,6 @@ class BirthdayCalendarGenerator {
     protected $objects = [];
 
     /**
-     * Reference timezone.
-     *
-     * When generating events, and we come across so-called
-     * floating times (times without a timezone), we use the reference timezone
-     * instead.
-     *
-     * This is also used for all-day events.
-     *
-     * This defaults to UTC.
-     *
-     * @var DateTimeZone
-     */
-    protected $timeZone;
-
-    /**
      * Default year.
      * Used for dates without a year.
      *
@@ -58,17 +42,12 @@ class BirthdayCalendarGenerator {
      * arguments.
      *
      * @param mixed $objects
-     * @param DateTimeZone $timeZone
      */
-    function __construct($objects = null, DateTimeZone $timeZone = null) {
+    function __construct($objects = null) {
 
         if ($objects) {
             $this->setObjects($objects);
         }
-        if (is_null($timeZone)) {
-            $timeZone = new DateTimeZone('UTC');
-        }
-        $this->setTimeZone($timeZone);
 
     }
 
@@ -115,19 +94,6 @@ class BirthdayCalendarGenerator {
     }
 
     /**
-     * Sets the reference timezone for floating times.
-     *
-     * @param DateTimeZone $timeZone
-     *
-     * @return void
-     */
-    function setTimeZone(DateTimeZone $timeZone) {
-
-        $this->timeZone = $timeZone;
-
-    }
-
-    /**
      * Sets the output format for the SUMMARY
      *
      * @param string $format
@@ -184,7 +150,7 @@ class BirthdayCalendarGenerator {
             // Create event.
             $event = $calendar->add('VEVENT', [
                 'SUMMARY'      => sprintf($this->format, $object->FN->getValue()),
-                'DTSTART'      => new \DateTime($object->BDAY->getValue(), $this->timeZone),
+                'DTSTART'      => new \DateTime($object->BDAY->getValue()),
                 'RRULE'        => 'FREQ=YEARLY',
                 'TRANSP'       => 'TRANSPARENT',
             ]);

-- 
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