diff options
author | Damon Chaplin <damon@ximian.com> | 2001-07-11 11:56:03 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-07-11 11:56:03 +0800 |
commit | 0e6d346872289d1ee71cb7b1092b5229b11dab3e (patch) | |
tree | 588b9cbac780c577af5c56d020c98f2f3822b38f /calendar/gui/gnome-cal.c | |
parent | 552d3501e9bf05d42ce6f342e85a526a1cea702c (diff) | |
download | gsoc2013-evolution-0e6d346872289d1ee71cb7b1092b5229b11dab3e.tar.gz gsoc2013-evolution-0e6d346872289d1ee71cb7b1092b5229b11dab3e.tar.zst gsoc2013-evolution-0e6d346872289d1ee71cb7b1092b5229b11dab3e.zip |
more timezone updates. I'm pretty much done with the calendar code now,
2001-07-10 Damon Chaplin <damon@ximian.com>
* gui/calendar-model.c:
* 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-week-view.c:
* gui/gnome-cal.c:
* gui/print.c:
* gui/dialogs/cal-prefs-dialog.c:
* gui/dialogs/comp-editor-util.c:
* gui/dialogs/event-page.c:
* pcs/cal-backend-file.c:
* pcs/query.c:
* cal-util/cal-component.[hc]:
* cal-util/cal-recur.c:
* cal-util/timeutil.[hc]:
* cal-client/cal-client.[hc]: more timezone updates. I'm pretty much
done with the calendar code now, except for alarms and conduits,
which Federico and JP know more about. And there are a couple of
other minor things to fix. But it is still pretty buggy.
svn path=/trunk/; revision=10984
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 5ea48a4d6e..166f715fa4 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -351,19 +351,14 @@ static struct tm get_current_time (ECalendarItem *calitem, gpointer data) { GnomeCalendar *cal = data; - char *location; - icaltimezone *zone; struct tm tmp_tm = { 0 }; struct icaltimetype tt; g_return_val_if_fail (cal != NULL, tmp_tm); g_return_val_if_fail (GNOME_IS_CALENDAR (cal), tmp_tm); - /* Get the current timezone. */ - location = calendar_config_get_timezone (); - zone = icaltimezone_get_builtin_timezone (location); - - tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone); + tt = icaltime_from_timet_with_zone (time (NULL), FALSE, + cal->priv->zone); /* Now copy it to the struct tm and return it. */ tmp_tm.tm_year = tt.year - 1900; @@ -505,8 +500,9 @@ gnome_calendar_init (GnomeCalendar *gcal) setup_widgets (gcal); - priv->selection_start_time = time_day_begin (time (NULL)); - priv->selection_end_time = time_add_day (priv->selection_start_time, 1); + priv->selection_start_time = time_day_begin_with_zone (time (NULL), + priv->zone); + priv->selection_end_time = time_add_day_with_zone (priv->selection_start_time, 1, priv->zone); priv->view_collection = NULL; priv->view_menus = NULL; @@ -585,8 +581,9 @@ gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time) priv = gcal->priv; - priv->selection_start_time = time_day_begin (new_time); - priv->selection_end_time = time_add_day (priv->selection_start_time, 1); + priv->selection_start_time = time_day_begin_with_zone (new_time, + priv->zone); + priv->selection_end_time = time_add_day_with_zone (priv->selection_start_time, 1, priv->zone); gnome_calendar_update_view_times (gcal); gnome_calendar_update_date_navigator (gcal); @@ -644,23 +641,31 @@ gnome_calendar_direction (GnomeCalendar *gcal, int direction) switch (priv->current_view_type) { case GNOME_CAL_DAY_VIEW: - start_time = time_add_day (start_time, direction); - end_time = time_add_day (end_time, direction); + start_time = time_add_day_with_zone (start_time, direction, + priv->zone); + end_time = time_add_day_with_zone (end_time, direction, + priv->zone); break; case GNOME_CAL_WORK_WEEK_VIEW: - start_time = time_add_week (start_time, direction); - end_time = time_add_week (end_time, direction); + start_time = time_add_week_with_zone (start_time, direction, + priv->zone); + end_time = time_add_week_with_zone (end_time, direction, + priv->zone); break; case GNOME_CAL_WEEK_VIEW: - start_time = time_add_week (start_time, direction); - end_time = time_add_week (end_time, direction); + start_time = time_add_week_with_zone (start_time, direction, + priv->zone); + end_time = time_add_week_with_zone (end_time, direction, + priv->zone); break; case GNOME_CAL_MONTH_VIEW: - start_time = time_add_month (start_time, direction); - end_time = time_add_month (end_time, direction); + start_time = time_add_month_with_zone (start_time, direction, + priv->zone); + end_time = time_add_month_with_zone (end_time, direction, + priv->zone); break; default: @@ -704,8 +709,9 @@ gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time) priv = gcal->priv; - priv->selection_start_time = time_day_begin (time); - priv->selection_end_time = time_add_day (priv->selection_start_time, 1); + priv->selection_start_time = time_day_begin_with_zone (time, + priv->zone); + priv->selection_end_time = time_add_day_with_zone (priv->selection_start_time, 1, priv->zone); if (priv->day_button) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->day_button), TRUE); |