aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/tag-calendar.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-07-03 12:21:37 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-07-03 12:21:37 +0800
commit642d32d63f226cd1ba049a9d979132e1a1cef94d (patch)
treebe4ef8fb72ca41391007554a6cbe97af41533555 /calendar/gui/tag-calendar.c
parentbacd3a85a434032316b3e63b95282175ce2b0659 (diff)
downloadgsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.gz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.bz2
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.lz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.xz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.zst
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.zip
cal-client/cal-client.[hc] cal-util/cal-component.c
2001-07-03 Damon Chaplin <damon@ximian.com> * cal-client/cal-client.[hc] * cal-util/cal-component.c * cal-util/cal-recur.[hc] * cal-util/test-recur.c * cal-util/timeutil.c * gui/calendar-config.c * gui/calendar-model.[hc] * gui/comp-util.[hc] * gui/e-calendar-table.c * gui/e-day-view-main-item.c * gui/e-day-view-top-item.c * gui/e-day-view.[hc] * gui/e-itip-control.c * gui/e-timezone-entry.[hc] * gui/e-week-view.[hc] * gui/gnome-cal.[hc] * gui/goto.c * gui/tag-calendar.[hc] * gui/dialogs/cal-prefs-dialog.c * gui/dialogs/comp-editor-page.[hc] * gui/dialogs/comp-editor-util.[hc] * gui/dialogs/comp-editor.c * gui/dialogs/e-timezone-dialog.[hc] * gui/dialogs/event-page.c * gui/dialogs/meeting-page.c * gui/dialogs/recurrence-page.c * gui/dialogs/task-details-page.c * gui/dialogs/task-details-page.glade * gui/dialogs/task-page.c * idl/evolution-calendar.idl * pcs/cal-backend-file.c * pcs/cal-backend.c * pcs/cal-backend.h * pcs/cal.c * pcs/query.c: timezone changes everywhere. There's still quite a few things to update, and its not working well at present. svn path=/trunk/; revision=10729
Diffstat (limited to 'calendar/gui/tag-calendar.c')
-rw-r--r--calendar/gui/tag-calendar.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
index 3d6ba40f45..485e013c4e 100644
--- a/calendar/gui/tag-calendar.c
+++ b/calendar/gui/tag-calendar.c
@@ -25,12 +25,14 @@
#endif
#include <cal-util/timeutil.h>
+#include "calendar-config.h"
#include "tag-calendar.h"
struct calendar_tag_closure {
ECalendarItem *calitem;
+ icaltimezone *zone;
time_t start_time;
time_t end_time;
};
@@ -44,7 +46,9 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c)
{
gint start_year, start_month, start_day;
gint end_year, end_month, end_day;
- struct tm start_tm = { 0 }, end_tm = { 0 };
+ struct icaltimetype start_tt = icaltime_null_time ();
+ struct icaltimetype end_tt = icaltime_null_time ();
+ char *location;
e_calendar_item_clear_marks (ecal->calitem);
@@ -54,25 +58,26 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c)
&end_year, &end_month, &end_day))
return FALSE;
- start_tm.tm_year = start_year - 1900;
- start_tm.tm_mon = start_month;
- start_tm.tm_mday = start_day;
- start_tm.tm_hour = 0;
- start_tm.tm_min = 0;
- start_tm.tm_sec = 0;
- start_tm.tm_isdst = -1;
-
- end_tm.tm_year = end_year - 1900;
- end_tm.tm_mon = end_month;
- end_tm.tm_mday = end_day + 1;
- end_tm.tm_hour = 0;
- end_tm.tm_min = 0;
- end_tm.tm_sec = 0;
- end_tm.tm_isdst = -1;
+ start_tt.year = start_year;
+ start_tt.month = start_month + 1;
+ start_tt.day = start_day;
+ start_tt.is_daylight = -1;
+
+ end_tt.year = end_year;
+ end_tt.month = end_month + 1;
+ end_tt.day = end_day;
+ end_tt.is_daylight = -1;
+
+ icaltime_adjust (&end_tt, 1, 0, 0, 0);
c->calitem = ecal->calitem;
- c->start_time = mktime (&start_tm);
- c->end_time = mktime (&end_tm);
+
+ /* FIXME. It may be better if the timezone is passed in. */
+ location = calendar_config_get_timezone ();
+ c->zone = icaltimezone_get_builtin_timezone (location);
+
+ c->start_time = icaltime_as_timet_with_zone (start_tt, c->zone);
+ c->end_time = icaltime_as_timet_with_zone (end_tt, c->zone);
return TRUE;
}
@@ -85,21 +90,16 @@ tag_calendar_cb (CalComponent *comp,
gpointer data)
{
struct calendar_tag_closure *c = data;
- time_t t;
-
- t = time_day_begin (istart);
-
- do {
- struct tm tm;
-
- tm = *localtime (&t);
-
- e_calendar_item_mark_day (c->calitem, tm.tm_year + 1900,
- tm.tm_mon, tm.tm_mday,
- E_CALENDAR_ITEM_MARK_BOLD);
+ struct icaltimetype start_tt, end_tt;
- t = time_day_end (t);
- } while (t < iend);
+ start_tt = icaltime_from_timet_with_zone (istart, FALSE, c->zone);
+ end_tt = icaltime_from_timet_with_zone (iend, FALSE, c->zone);
+ e_calendar_item_mark_days (c->calitem,
+ start_tt.year, start_tt.month - 1,
+ start_tt.day,
+ end_tt.year, end_tt.month - 1,
+ end_tt.day,
+ E_CALENDAR_ITEM_MARK_BOLD);
return TRUE;
}
@@ -149,7 +149,7 @@ tag_calendar_by_client (ECalendar *ecal, CalClient *client)
* component that occur within the calendar's current time range.
**/
void
-tag_calendar_by_comp (ECalendar *ecal, CalComponent *comp)
+tag_calendar_by_comp (ECalendar *ecal, CalComponent *comp, CalClient *client)
{
struct calendar_tag_closure c;
@@ -168,5 +168,7 @@ tag_calendar_by_comp (ECalendar *ecal, CalComponent *comp)
#if 0
g_print ("DateNavigator generating instances\n");
#endif
- cal_recur_generate_instances (comp, c.start_time, c.end_time, tag_calendar_cb, &c);
+ cal_recur_generate_instances (comp, c.start_time, c.end_time,
+ tag_calendar_cb, &c,
+ cal_client_resolve_tzid, client);
}