]> git.0d.be Git - empathy.git/commitdiff
empathy_time_to_string_relative was missing weeks
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>
Sun, 14 Jun 2009 18:05:53 +0000 (14:05 -0400)
committerXavier Claessens <xclaesse@gmail.com>
Mon, 15 Jun 2009 14:40:24 +0000 (16:40 +0200)
This resulted in "0 month ago" being returned.

libempathy/empathy-time.c

index 64350404c3bca9457bd6f45daffc4c7d0b277f0f..5a934a5e3456a7a6ac340a651ef79b2eb220eadd 100644 (file)
@@ -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",