librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1097] Some tracks were reported as '7 days ago', othe


From: Toby Inkster
Subject: [Librefm-commits] [1097] Some tracks were reported as '7 days ago', others as ' about a week ago' and others still as '1 weeks ago'.
Date: Fri, 01 May 2009 11:04:37 +0000

Revision: 1097
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1097
Author:   tobyink
Date:     2009-05-01 11:04:37 +0000 (Fri, 01 May 2009)
Log Message:
-----------
Some tracks were reported as '7 days ago', others as 'about a week ago' and 
others still as '1 weeks ago'.
Now these are all 'about a week ago'.

Modified Paths:
--------------
    trunk/nixtape/utils/human-time.php

Modified: trunk/nixtape/utils/human-time.php
===================================================================
--- trunk/nixtape/utils/human-time.php  2009-05-01 09:00:46 UTC (rev 1096)
+++ trunk/nixtape/utils/human-time.php  2009-05-01 11:04:37 UTC (rev 1097)
@@ -74,6 +74,8 @@
             break;
         case ($diff < 604800):
             # less than a week
+            if (round($diff / 86400) == 7)
+                return 'about a week ago';
             return round($diff / 86400) . ' days ago';
             break;
         case ($diff < 691200):
@@ -82,6 +84,8 @@
             break;
         case ($diff < 2764800):
             # less than a month
+            if (round($diff / 691200) == 1)
+                return 'about a week ago';
             return round($diff / 691200) . ' weeks ago';
             break;
         case ($diff < 4579200):





reply via email to

[Prev in Thread] Current Thread [Next in Thread]