From: Ben Klang Date: Tue, 8 Jun 2010 19:36:34 +0000 (-0400) Subject: Pastie: Use Horde_Date_Util to calculate time delta X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=74614e5c35bac54cddcda3436c871c1e70b18967;p=horde.git Pastie: Use Horde_Date_Util to calculate time delta --- diff --git a/pastie/templates/recent.inc b/pastie/templates/recent.inc index 79a669b68..30ad398d7 100644 --- a/pastie/templates/recent.inc +++ b/pastie/templates/recent.inc @@ -10,14 +10,7 @@ foreach ($recent as $r) { if (empty($r['title'])) { $r['title'] = _("[Untitled]"); } - $then = new DateTime('@' . $r['timestamp']->timestamp()); - $ago = $now->diff($then, true); - $days = $ago->format("%a"); - if ($days > 0) { - $ago = $ago->format("%a days %H:%i ago"); - } else { - $ago = $ago->format("%H:%i min ago"); - } + $ago = Horde_Date_Util::relativeDateTime($r['timestamp']->timestamp()); ?>