From f1189af2c5650d270be852ee62916a41a15c9c3a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 17 Feb 2014 15:00:24 +0100 Subject: Make calendar tooltip count also days, not only hours/minutes/seconds --- calendar/gui/misc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'calendar') diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c index 6562cf3f78..eba20beb0f 100644 --- a/calendar/gui/misc.c +++ b/calendar/gui/misc.c @@ -83,11 +83,19 @@ calculate_time (time_t start, time_t difference = end - start; gchar *str; gint hours, minutes; - gchar *times[4]; + gchar *times[5]; gchar *joined; gint i; i = 0; + if (difference >= 24 * 3600) { + gint days; + + days = difference / (24 * 3600); + difference %= (24 * 3600); + + times[i++] = g_strdup_printf (ngettext ("%d day", "%d days", days), days); + } if (difference >= 3600) { hours = difference / 3600; difference %= 3600; -- cgit v1.2.3