[empathy] empathy_time_to_string_relative was missing weeks



commit d563a37f9f94ab5f8c77cbf644d8d2901ad74476
Author: Pierre-Luc Beaudoin <pierre-luc beaudoin collabora co uk>
Date:   Sun Jun 14 14:05:53 2009 -0400

    empathy_time_to_string_relative was missing weeks
    
    This resulted in "0 month ago" being returned.

 libempathy/empathy-time.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-time.c b/libempathy/empathy-time.c
index 6435040..5a934a5 100644
--- a/libempathy/empathy-time.c
+++ b/libempathy/empathy-time.c
@@ -152,6 +152,11 @@ empathy_time_to_string_relative (time_t then)
 			return g_strdup_printf (ngettext ("%d day ago",
 				"%d days ago", seconds), seconds);
 		}
+		else if (seconds < (60 * 60 * 24 * 30)) {
+			seconds /= 60 * 60 * 24 * 7;
+			return g_strdup_printf (ngettext ("%d week ago",
+				"%d weeks ago", seconds), seconds);
+		}
 		else {
 			seconds /= 60 * 60 * 24 * 30;
 			return g_strdup_printf (ngettext ("%d month ago",



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