[evolution] Make calendar tooltip count also days, not only hours/minutes/seconds
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Make calendar tooltip count also days, not only hours/minutes/seconds
- Date: Mon, 17 Feb 2014 14:00:51 +0000 (UTC)
commit f1189af2c5650d270be852ee62916a41a15c9c3a
Author: Milan Crha <mcrha redhat com>
Date: Mon Feb 17 15:00:24 2014 +0100
Make calendar tooltip count also days, not only hours/minutes/seconds
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 6562cf3..eba20be 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]