[gnome-calendar] window: correctly check today for week view
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: correctly check today for week view
- Date: Fri, 17 Mar 2017 19:12:47 +0000 (UTC)
commit fa7f5795929eb011b69d1f1beb27c2661b747d65
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Mar 17 16:11:42 2017 -0300
window: correctly check today for week view
src/gcal-window.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 7856abe..e0719ac 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -171,6 +171,8 @@ update_today_button_sensitive (GcalWindow *window)
g_autoptr (GDateTime) now;
gboolean sensitive;
+ GCAL_ENTRY;
+
now = g_date_time_new_now_local ();
switch (window->active_view)
@@ -183,7 +185,11 @@ update_today_button_sensitive (GcalWindow *window)
case GCAL_WINDOW_VIEW_WEEK:
sensitive = window->active_date->year != g_date_time_get_year (now) ||
- icaltime_week_number (*window->active_date) != g_date_time_get_week_of_year (now);
+ icaltime_week_number (*window->active_date) != g_date_time_get_week_of_year (now) - 1;
+
+ GCAL_TRACE_MSG ("Week: active date's week is %d, current week is %d",
+ icaltime_week_number (*window->active_date) + 1,
+ g_date_time_get_week_of_year (now));
break;
case GCAL_WINDOW_VIEW_MONTH:
@@ -203,6 +209,8 @@ update_today_button_sensitive (GcalWindow *window)
}
gtk_widget_set_sensitive (window->today_button, sensitive);
+
+ GCAL_EXIT;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]