summaryrefslogtreecommitdiff
path: root/includes/functions.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-24 11:45:36 +0100
committerMinteck <contact@minteck.org>2023-02-24 11:45:36 +0100
commit15bb1453008237edbc2cb4e82a9eb44db6f99794 (patch)
treea0e07c50b7f38b5a1a399ef1bf5c1264a6fc1d6c /includes/functions.inc
parent3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (diff)
downloadpluralconnect-15bb1453008237edbc2cb4e82a9eb44db6f99794.tar.gz
pluralconnect-15bb1453008237edbc2cb4e82a9eb44db6f99794.tar.bz2
pluralconnect-15bb1453008237edbc2cb4e82a9eb44db6f99794.zip
Updated 10 files (automated)
Diffstat (limited to 'includes/functions.inc')
-rw-r--r--includes/functions.inc21
1 files changed, 5 insertions, 16 deletions
diff --git a/includes/functions.inc b/includes/functions.inc
index 5effe5b..7a6ad5d 100644
--- a/includes/functions.inc
+++ b/includes/functions.inc
@@ -388,25 +388,19 @@ if (!function_exists("timeAgo")) {
$time = strtotime($time);
}
- $periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"];
- $periods_fr = ["sec.", "mn.", "hr.", "j.", "sem.", "m.", "a.", "des années"];
+ $periods = ["sec", "min", "hr", "d", "wk", "mo", "y", "ages"];
+ $periods_fr = $periods;
$lengths = array("60", "60", "24", "7", "4.35", "12", "100");
$now = time();
$difference = $now - $time;
if ($difference <= 10 && $difference >= 0) {
- if ($french) {
- return $tense_fr = "à l'instant";
- } else {
- return $tense = "now";
- }
+ return $tense = "now";
} elseif ($difference > 0) {
$tense = "ago";
- $tense_fr = "il y a";
} else {
$tense = "later";
- $tense_fr = "dans";
}
for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
@@ -415,13 +409,8 @@ if (!function_exists("timeAgo")) {
$difference = round($difference);
- if ($french) {
- $period = $periods_fr[$j];
- return "{$tense_fr} {$difference} {$period}";
- } else {
- $period = $periods[$j];
- return "{$difference} {$period} {$tense}";
- }
+ $period = $periods[$j];
+ return "{$difference} {$period} {$tense}";
}
}