From 74614e5c35bac54cddcda3436c871c1e70b18967 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 8 Jun 2010 15:36:34 -0400 Subject: [PATCH] Pastie: Use Horde_Date_Util to calculate time delta --- pastie/templates/recent.inc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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()); ?>

-- 2.11.0