From 302eaef890f4a90e83b2118bd96e2c1fc459712e Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Wed, 5 Sep 2001 22:28:39 +0000 Subject: USe 24hr clock if appropriate, don't mess with the date and time svn path=/trunk/; revision=12635 --- my-evolution/ChangeLog | 8 ++++++++ my-evolution/e-summary-calendar.c | 40 ++++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 2661996642..f66ab4db98 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,11 @@ +2001-09-05 Iain Holmes + + * e-summary-calendar.c (generate_html): Check if we need to use 24hr + format. Don't try to do fancy things with the date and time of an + appointment. + (locale_uses_24h_time_format): Cut and pasted from calendar. + (e_summary_calendar_init): Get the 24hour preferences from the calendar. + 2001-09-04 Iain Holmes * Locations: Applied patch from Evert Verhellen to fix the Belgium diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c index ca7b8bacab..ab143cc718 100644 --- a/my-evolution/e-summary-calendar.c +++ b/my-evolution/e-summary-calendar.c @@ -18,10 +18,15 @@ #include #include +#include +#include +#include + struct _ESummaryCalendar { CalClient *client; char *html; + gboolean wants24hr; }; const char * @@ -169,6 +174,7 @@ generate_html (gpointer data) break; case E_SUMMARY_CALENDAR_ONE_MONTH: + default: f = time_add_month (t, 1); end = time_day_end (f); break; @@ -228,16 +234,10 @@ generate_html (gpointer data) start_str = g_new (char, 20); start_tm = localtime (&start_t); - 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); + if (calendar->wants24hr == TRUE) { + strftime (start_str, 19, _("%k%M %d %B"), start_tm); } else { - strftime (start_str, 19, _("%d %B"), start_tm); + strftime (start_str, 19, _("%l:%M %d %B"), start_tm); } tmp = g_strdup_printf ("wants24hr = bonobo_config_get_boolean_with_default (db, "/Calendar/Display/Use24HourFormat", locale_uses_24h_time_format (), NULL); + bonobo_object_release_unref (db, NULL); + } + CORBA_exception_free (&ev); + e_summary_add_protocol_listener (summary, "calendar", e_summary_calendar_protocol, calendar); } -- cgit v1.2.3