From e1635ef07ac4dbbb2511a01ed32ef096399d11fb Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Wed, 29 Nov 2000 00:19:44 +0000 Subject: finished 12-hour support and tried to tidy up & comment the drawing code 2000-11-28 Damon Chaplin * gui/e-day-view*.[hc]: * gui/e-week-view*.[hc]: finished 12-hour support and tried to tidy up & comment the drawing code in places. Also fixed a couple of bugs I spotted. All the options on the 'Calendar' page should now work. svn path=/trunk/; revision=6706 --- calendar/gui/gnome-cal.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 802f76341c..b423ffcd41 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1586,7 +1586,6 @@ gnome_calendar_update_config_settings (GnomeCalendar *gcal, /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */ week_start_day = (week_start_day + 6) % 7; - g_print ("Setting week start day to %i (0=Sun)\n", week_start_day); e_day_view_set_week_start_day (E_DAY_VIEW (priv->day_view), week_start_day); e_day_view_set_week_start_day (E_DAY_VIEW (priv->work_week_view), @@ -1615,13 +1614,10 @@ gnome_calendar_update_config_settings (GnomeCalendar *gcal, use_24_hour); e_day_view_set_24_hour_format (E_DAY_VIEW (priv->work_week_view), use_24_hour); - /* FIXME: Add support for these. */ -#if 0 e_week_view_set_24_hour_format (E_WEEK_VIEW (priv->week_view), use_24_hour); e_week_view_set_24_hour_format (E_WEEK_VIEW (priv->month_view), use_24_hour); -#endif time_divisions = calendar_config_get_time_divisions (); e_day_view_set_mins_per_row (E_DAY_VIEW (priv->day_view), @@ -1959,8 +1955,11 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, new_days_shown = g_date_julian (&new_end_date) - g_date_julian (&new_start_date) + 1; - /* FIXME: This assumes weeks start on Monday for now. */ - if (g_date_weekday (&new_start_date) - 1 == 0) + /* If a complete week is selected we show the Week view. + Note that if weekends are compressed and the week start day is set + to Sunday we don't actually show complete weeks in the Week view, + so this may need tweaking. */ + if ((g_date_weekday (&new_start_date) + 5) % 7 == calendar_config_get_week_start_day ()) starts_on_week_start_day = TRUE; /* Switch views as appropriate, and change the number of days or weeks -- cgit v1.2.3