]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Event.php
Merge pull request #8344 from MrPetovan/bug/8339-remote-follow-local-profile
[friendica.git] / src / Model / Event.php
index 6f309a3397594479075c49d13f30ee4ea05c25d2..b8d578bbad4e353b62cc2ae8d6e8b193c5bacbd2 100644 (file)
@@ -1,13 +1,28 @@
 <?php
 /**
- * @file src/Model/Event.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 namespace Friendica\Model;
 
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Hook;
-use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
@@ -33,13 +48,13 @@ class Event
 
                $bd_format = DI::l10n()->t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8 AM.
 
-               $event_start = L10n::getDay(
+               $event_start = DI::l10n()->getDay(
                        !empty($event['adjust']) ?
                        DateTimeFormat::local($event['start'], $bd_format) : DateTimeFormat::utc($event['start'], $bd_format)
                );
 
                if (!empty($event['finish'])) {
-                       $event_end = L10n::getDay(
+                       $event_end = DI::l10n()->getDay(
                                !empty($event['adjust']) ?
                                DateTimeFormat::local($event['finish'], $bd_format) : DateTimeFormat::utc($event['finish'], $bd_format)
                        );
@@ -571,7 +586,7 @@ class Event
                        $start = $event['adjust'] ? DateTimeFormat::local($event['start'], 'c')  : DateTimeFormat::utc($event['start'], 'c');
                        $j     = $event['adjust'] ? DateTimeFormat::local($event['start'], 'j')  : DateTimeFormat::utc($event['start'], 'j');
                        $day   = $event['adjust'] ? DateTimeFormat::local($event['start'], $fmt) : DateTimeFormat::utc($event['start'], $fmt);
-                       $day   = L10n::getDay($day);
+                       $day   = DI::l10n()->getDay($day);
 
                        if ($event['nofinish']) {
                                $end = null;
@@ -849,14 +864,14 @@ class Event
                $tformat       = DI::l10n()->t('g:i A'); // 8:01 AM.
 
                // Convert the time to different formats.
-               $dtstart_dt = L10n::getDay(
+               $dtstart_dt = DI::l10n()->getDay(
                        $item['event-adjust'] ?
                                DateTimeFormat::local($item['event-start'], $dformat)
                                : DateTimeFormat::utc($item['event-start'], $dformat)
                );
                $dtstart_title = DateTimeFormat::utc($item['event-start'], $item['event-adjust'] ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s');
                // Format: Jan till Dec.
-               $month_short = L10n::getDayShort(
+               $month_short = DI::l10n()->getDayShort(
                        $item['event-adjust'] ?
                                DateTimeFormat::local($item['event-start'], 'M')
                                : DateTimeFormat::utc($item['event-start'], 'M')
@@ -868,7 +883,7 @@ class Event
                $start_time = $item['event-adjust'] ?
                        DateTimeFormat::local($item['event-start'], $tformat)
                        : DateTimeFormat::utc($item['event-start'], $tformat);
-               $start_short = L10n::getDayShort(
+               $start_short = DI::l10n()->getDayShort(
                        $item['event-adjust'] ?
                                DateTimeFormat::local($item['event-start'], $dformat_short)
                                : DateTimeFormat::utc($item['event-start'], $dformat_short)
@@ -877,13 +892,13 @@ class Event
                // If the option 'nofinisch' isn't set, we need to format the finish date/time.
                if (!$item['event-nofinish']) {
                        $finish = true;
-                       $dtend_dt  = L10n::getDay(
+                       $dtend_dt  = DI::l10n()->getDay(
                                $item['event-adjust'] ?
                                        DateTimeFormat::local($item['event-finish'], $dformat)
                                        : DateTimeFormat::utc($item['event-finish'], $dformat)
                        );
                        $dtend_title = DateTimeFormat::utc($item['event-finish'], $item['event-adjust'] ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s');
-                       $end_short = L10n::getDayShort(
+                       $end_short = DI::l10n()->getDayShort(
                                $item['event-adjust'] ?
                                        DateTimeFormat::local($item['event-finish'], $dformat_short)
                                        : DateTimeFormat::utc($item['event-finish'], $dformat_short)