From d503c5e7568c0cc1ce13550865a543d8ffbbf056 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Thu, 27 Sep 2001 20:51:20 +0000 Subject: Make the show todays tasks work. svn path=/trunk/; revision=13197 --- my-evolution/e-summary-tasks.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'my-evolution/e-summary-tasks.c') diff --git a/my-evolution/e-summary-tasks.c b/my-evolution/e-summary-tasks.c index 05cb741ee0..9ed5c6bc55 100644 --- a/my-evolution/e-summary-tasks.c +++ b/my-evolution/e-summary-tasks.c @@ -160,20 +160,23 @@ sort_uids (gconstpointer a, } static GList * -get_todays_uids (CalClient *client, +get_todays_uids (ESummary *summary, + CalClient *client, GList *uids) { GList *today = NULL, *p; - time_t todays_end, todays_start; + time_t todays_end, todays_start, t; - todays_start = time_day_begin (time (NULL)); - todays_end = time_day_end (time (NULL)); + t = time (NULL); + todays_start = time_day_begin_with_zone (t, summary->tz); + todays_end = time_day_end_with_zone (t, summary->tz); for (p = uids; p; p = p->next) { char *uid; CalComponent *comp; CalClientGetStatus status; - CalComponentDateTime end; + CalComponentDateTime due; + icaltimezone *zone; time_t endt; uid = p->data; @@ -182,15 +185,18 @@ get_todays_uids (CalClient *client, continue; } - cal_component_get_dtend (comp, &end); - if (end.value != 0) { - endt = icaltime_as_timet (*end.value); + cal_component_get_due (comp, &due); + + cal_client_get_timezone (client, due.tzid, &zone); + if (due.value != 0) { + icaltimezone_convert_time (due.value, zone, summary->tz); + endt = icaltime_as_timet (*due.value); if (endt >= todays_start && endt <= todays_end) { today = g_list_append (today, g_strdup (uid)); } } - cal_component_free_datetime (&end); + cal_component_free_datetime (&due); } if (today == NULL) { @@ -219,7 +225,7 @@ generate_html (gpointer data) if (summary->preferences->show_tasks == E_SUMMARY_CALENDAR_TODAYS_TASKS && uids != NULL) { GList *tmp; - tmp = get_todays_uids (tasks->client, uids); + tmp = get_todays_uids (summary, tasks->client, uids); cal_obj_uid_list_free (uids); uids = tmp; -- cgit v1.2.3