aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-time.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-06-15 02:05:53 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-06-15 22:40:24 +0800
commitd563a37f9f94ab5f8c77cbf644d8d2901ad74476 (patch)
tree3da55ea67c9dff4af9e3f16324a87b21ce5a3c3d /libempathy/empathy-time.c
parentec4b41130b1b9704abf190a470d65a9e41846284 (diff)
downloadgsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.tar
gsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.tar.gz
gsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.tar.bz2
gsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.tar.lz
gsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.tar.xz
gsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.tar.zst
gsoc2013-empathy-d563a37f9f94ab5f8c77cbf644d8d2901ad74476.zip
empathy_time_to_string_relative was missing weeks
This resulted in "0 month ago" being returned.
Diffstat (limited to 'libempathy/empathy-time.c')
-rw-r--r--libempathy/empathy-time.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libempathy/empathy-time.c b/libempathy/empathy-time.c
index 64350404c..5a934a5e3 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",