aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--my-evolution/ChangeLog5
-rw-r--r--my-evolution/e-summary-calendar.c20
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,5 +1,10 @@
2001-07-09 Iain Holmes <iain@ximian.com>
+ * e-summary-calendar.c (generate_html): Show varying times depending
+ on how soon the appointment is.
+
+2001-07-09 Iain Holmes <iain@ximian.com>
+
* e-summary-calendar.c (generate_html): Fix up the HTML so having
appointments doesn't mess up the display. Set the correct length of
time to show appointments.
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 ("<img align=\"middle\" src=\"es-appointments.png\" "
"alt=\"\" width=\"16\" height=\"16\"> &#160; "
"<font size=\"-1\"><a href=\"#\">%s, %s</a></font><br>",