diff options
-rw-r--r-- | engine/lib/elgglib.php | 15 | ||||
-rw-r--r-- | languages/en.php | 1 |
2 files changed, 10 insertions, 6 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 43dba4a43..09940082c 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1234,29 +1234,32 @@ function friendly_time($time) { $diff = 1; } if ($diff > 1) { - return sprintf(elgg_echo("friendlytime:minutes"),$diff); + $friendly_time = sprintf(elgg_echo("friendlytime:minutes"), $diff); } - return sprintf(elgg_echo("friendlytime:minutes:singular"),$diff); + $friendly_time = sprintf(elgg_echo("friendlytime:minutes:singular"), $diff); } else if ($diff < 86400) { $diff = round($diff / 3600); if ($diff == 0) { $diff = 1; } if ($diff > 1) { - return sprintf(elgg_echo("friendlytime:hours"),$diff); + $friendly_time = sprintf(elgg_echo("friendlytime:hours"), $diff); } - return sprintf(elgg_echo("friendlytime:hours:singular"),$diff); + $friendly_time = sprintf(elgg_echo("friendlytime:hours:singular"), $diff); } else { $diff = round($diff / 86400); if ($diff == 0) { $diff = 1; } if ($diff > 1) { - return sprintf(elgg_echo("friendlytime:days"),$diff); + $friendly_time = sprintf(elgg_echo("friendlytime:days"), $diff); } - return sprintf(elgg_echo("friendlytime:days:singular"),$diff); + $friendly_time = sprintf(elgg_echo("friendlytime:days:singular"), $diff); } + + $timestamp = htmlentities(date(elgg_echo('friendlytime:date_format', $time))); + return "<acronym title=\"$timestamp\">$friendly_time</acronym>"; } /** diff --git a/languages/en.php b/languages/en.php index b495c2396..61929d527 100644 --- a/languages/en.php +++ b/languages/en.php @@ -677,6 +677,7 @@ Once you have logged in, we highly recommend that you change your password. 'friendlytime:hours:singular' => "an hour ago", 'friendlytime:days' => "%s days ago", 'friendlytime:days:singular' => "yesterday", + 'friendlytime:date_format' => 'j F Y @ g:ia', 'date:month:01' => 'January %s', 'date:month:02' => 'February %s', |