From 1fa540053cdaaee1cbe76685458f98deba14ac00 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Mon, 9 Jul 2001 18:47:17 +0000 Subject: Better time reporting svn path=/trunk/; revision=10925 --- my-evolution/ChangeLog | 5 +++++ my-evolution/e-summary-calendar.c | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 03d42a0a5f..6cf79c79c3 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,8 @@ +2001-07-09 Iain Holmes + + * e-summary-calendar.c (generate_html): Show varying times depending + on how soon the appointment is. + 2001-07-09 Iain Holmes * e-summary-calendar.c (generate_html): Fix up the HTML so having diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c index 1bf6fc8872..43d1a9ac29 100644 --- a/my-evolution/e-summary-calendar.c +++ b/my-evolution/e-summary-calendar.c @@ -201,7 +201,7 @@ generate_html (gpointer data) CalComponentText text; CalClientGetStatus status; CalComponentDateTime start, end; - time_t start_t; + time_t start_t, dt; struct tm *start_tm; uid = l->data; @@ -218,14 +218,18 @@ generate_html (gpointer data) start_str = g_new (char, 20); start_tm = localtime (&start_t); - strftime (start_str, 19, _("%I:%M%p"), start_tm); + dt = start_t - t; + /* 86400 == 1 day + 604800 == 1 week + Otherwise: Month */ + if (dt < 86400) { + strftime (start_str, 19, _("%l:%M%p"), start_tm); + } else if (dt < 604800) { + strftime (start_str, 19, _("%a %l:%M%p"), start_tm); + } else { + strftime (start_str, 19, _("%d %B"), start_tm); + } -#if 0 - end_str = g_new (char, 20); - end_t = icaltime_as_timet (*end.value); - end_tm = localtime (&end_t); - strftime (end_str, 19, _("%I:%M%p"), end_tm); -#endif tmp = g_strdup_printf ("   " "%s, %s
", -- cgit v1.2.3