]> git.mxchange.org Git - friendica.git/commitdiff
Add Support for relativeDateTime in future + update Admin user waiting for deleting...
authorJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 14 Oct 2018 20:57:44 +0000 (22:57 +0200)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 14 Oct 2018 20:57:44 +0000 (22:57 +0200)
mod/admin.php
src/Util/Temporal.php

index d0e8ab0e38e65bbe22e2e2063944f638d3bcdcfe..b02db73bdd9bdf76468881ae6164c3fc8b185279 100644 (file)
@@ -1922,7 +1922,7 @@ function admin_page_users(App $a)
 
                '$h_users' => L10n::t('Users'),
                '$h_newuser' => L10n::t('New User'),
-               '$th_deleted' => [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Deleted since')],
+               '$th_deleted' => [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Delete in')],
                '$th_users' => $th_users,
                '$order_users' => $order,
                '$order_direction_users' => $order_direction,
index 46bd8bba50871deafc49449891feb330de8ebe70..696721e458c2d906f978f33fecda176fbe6d7938 100644 (file)
@@ -294,12 +294,18 @@ class Temporal
                        return L10n::t('never');
                }
 
+               $isfuture = false;
                $etime = time() - $abs;
 
-               if ($etime < 1) {
+               if ($etime < 1 && $etime >= 0) {
                        return L10n::t('less than a second ago');
                }
 
+               if ($etime < 0){
+                       $etime = -$etime;
+                       $isfuture = true;
+               }
+
                $a = [12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
                        30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
                        7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
@@ -315,7 +321,12 @@ class Temporal
                                $r = round($d);
                                // translators - e.g. 22 hours ago, 1 minute ago
                                if (!$format) {
-                                       $format = L10n::t('%1$d %2$s ago');
+                                       if($isfuture){
+                                               $format = L10n::t('in %1$d %2$s');
+                                       }
+                                       else {
+                                               $format = L10n::t('%1$d %2$s ago');
+                                       }
                                }
 
                                return sprintf($format, $r, (($r == 1) ? $str[0] : $str[1]));