diff options
author | Milan Crha <mcrha@redhat.com> | 2014-02-17 22:00:24 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-02-17 22:00:24 +0800 |
commit | f1189af2c5650d270be852ee62916a41a15c9c3a (patch) | |
tree | 2b74356e2d2c2ca798bc6c8a27dd382236a44142 | |
parent | 39fcd8e32539551ce3be61971501050579024703 (diff) | |
download | gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.tar gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.tar.gz gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.tar.bz2 gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.tar.lz gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.tar.xz gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.tar.zst gsoc2013-evolution-f1189af2c5650d270be852ee62916a41a15c9c3a.zip |
Make calendar tooltip count also days, not only hours/minutes/seconds
-rw-r--r-- | calendar/gui/misc.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; |