aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-07-10 02:47:17 +0800
committerIain Holmes <iain@src.gnome.org>2001-07-10 02:47:17 +0800
commit1fa540053cdaaee1cbe76685458f98deba14ac00 (patch)
tree6b3a9b66c27e1aa91aea64ae9cc9fa06b2521251
parent50813793c3393e70f5b3c46a7541c26d0e9d9c14 (diff)
downloadgsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.tar
gsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.tar.gz
gsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.tar.bz2
gsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.tar.lz
gsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.tar.xz
gsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.tar.zst
gsoc2013-evolution-1fa540053cdaaee1cbe76685458f98deba14ac00.zip
Better time reporting
svn path=/trunk/; revision=10925
-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>",