]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Temporal.php
Fix last reference of replaced variable $owner_nick in Protocol\Feed::atom()
[friendica.git] / src / Util / Temporal.php
index 74389c44b52b5eea3f1c6c3be2afbd2fdd907149..3946550628865706d88d5e5e85f41ea7656470b1 100644 (file)
@@ -238,7 +238,7 @@ class Temporal
                bool $required = false): string
        {
                // First day of the week (0 = Sunday)
-               $firstDay = DI::pConfig()->get(local_user(), 'system', 'first_day_of_week', 0);
+               $firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week', 0);
 
                $lang = substr(DI::l10n()->getCurrentLang(), 0, 2);
 
@@ -311,13 +311,16 @@ class Temporal
         *
         * @return string with relative date
         */
-       public static function getRelativeDate(string $posted_date, string $format = null): string
+       public static function getRelativeDate(string $posted_date = null, string $format = null): string
        {
-               $localtime = $posted_date . ' UTC';
+               if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME) {
+                       return DI::l10n()->t('never');
+               }
 
+               $localtime = $posted_date . ' UTC';
                $abs = strtotime($localtime);
 
-               if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME || $abs === false) {
+               if ($abs === false) {
                        return DI::l10n()->t('never');
                }