]> git.mxchange.org Git - friendica-addons.git/commitdiff
Add Temporal::local() shorthand for Temporal::convert()
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 27 Jan 2018 00:33:46 +0000 (19:33 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 3 Feb 2018 16:40:39 +0000 (11:40 -0500)
dav/friendica/dav_caldav_backend_virtual_friendica.inc.php
membersince/membersince.php

index 3baaa10c8272c3bab590271d6f09bdf24e7d4357..092dbbd8028fd975ee89d75e6c1ec4f55e0d0d03 100644 (file)
@@ -68,8 +68,8 @@ class Sabre_CalDAV_Backend_Friendica extends Sabre_CalDAV_Backend_Virtual
                        $component = dav_get_eventComponent($vevent);
 
                        if ($row["adjust"]) {
-                               $start  = Temporal::convert($row["start"], date_default_timezone_get());
-                               $finish = Temporal::convert($row["finish"], date_default_timezone_get());
+                               $start  = Temporal::local($row["start"]);
+                               $finish = Temporal::local($row["finish"]);
                        } else {
                                $start  = $row["start"];
                                $finish = $row["finish"];
@@ -116,8 +116,8 @@ class Sabre_CalDAV_Backend_Friendica extends Sabre_CalDAV_Backend_Virtual
        private function jqcal2wdcal($row, $calendar, $base_path)
        {
                if ($row["adjust"]) {
-                       $start  = Temporal::convert($row["start"], date_default_timezone_get());
-                       $finish = Temporal::convert($row["finish"], date_default_timezone_get());
+                       $start  = Temporal::local($row["start"]);
+                       $finish = Temporal::local($row["finish"]);
                } else {
                        $start  = $row["start"];
                        $finish = $row["finish"];
index b8bbca49af21fe84a544e7ddf06bca7a11ad20ad..fb923bde1467e4df26e5dba56878241f17b57109 100644 (file)
@@ -26,8 +26,8 @@ function membersince_uninstall()
 function membersince_display(&$a, &$b)
 {
        // Works in Vier
-       $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . L10n::t('Member since:') . "</dt>\n<dd>" . Temporal::convert($a->profile['register_date'], date_default_timezone_get()) . "</dd>\n</dl>", $b, 1);
+       $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . L10n::t('Member since:') . "</dt>\n<dd>" . Temporal::local($a->profile['register_date']) . "</dd>\n</dl>", $b, 1);
 
        // Trying for Frio
-       //$b = preg_replace('/<\/div>/', "<div id=\"aprofile-membersince\" class=\"aprofile\"><hr class=\"profile-separator\"><div class=\"profile-label-name\">" . L10n::t('Member since:') . "</div><div class=\"profile-entry\">" . Temporal::convert($a->profile['register_date'], date_default_timezone_get()) . "</div></div>", $b, 1);
+       //$b = preg_replace('/<\/div>/', "<div id=\"aprofile-membersince\" class=\"aprofile\"><hr class=\"profile-separator\"><div class=\"profile-label-name\">" . L10n::t('Member since:') . "</div><div class=\"profile-entry\">" . Temporal::local($a->profile['register_date']) . "</div></div>", $b, 1);
 }