]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Temporal.php
Friendica copyright changed from 2023 to 2034
[friendica.git] / src / Util / Temporal.php
index c3f744ba630796e156311f3a70db096e091842b0..d2599179faccafdfa9294b2c801e133892d068f9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -242,7 +242,7 @@ class Temporal
                // First day of the week (0 = Sunday)
                $firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'first_day_of_week', 0);
 
-               $lang = substr(DI::l10n()->getCurrentLang(), 0, 2);
+               $lang = DI::l10n()->toISO6391(DI::l10n()->getCurrentLang());
 
                // Check if the detected language is supported by the picker
                if (!in_array($lang,
@@ -361,7 +361,7 @@ class Temporal
                foreach ($a as $secs => $str) {
                        $d = $etime / $secs;
                        if ($d >= 1) {
-                               $r = round($d);
+                               $r = floor($d);
                                // translators - e.g. 22 hours ago, 1 minute ago
                                if($isfuture){
                                        $format = DI::l10n()->t('in %1$d %2$s');