[gnome-calendar] week-header: don't account first weekday twice
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] week-header: don't account first weekday twice
- Date: Tue, 14 Mar 2017 23:34:19 +0000 (UTC)
commit f608f8fd9d81a4367ccead6d0affc6ace56ba218
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Mar 14 20:27:32 2017 -0300
week-header: don't account first weekday twice
The auxiliary functions to calculate the week start
already takes the first weekday into account. We,
however, were considering it again when calculating
the event position.
Fix that by only considering it once, through the
get_start_of_week() function.
https://bugzilla.gnome.org/show_bug.cgi?id=780051
src/views/gcal-week-header.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/views/gcal-week-header.c b/src/views/gcal-week-header.c
index b6fc1dc..f44f7d0 100644
--- a/src/views/gcal-week-header.c
+++ b/src/views/gcal-week-header.c
@@ -1608,13 +1608,11 @@ gcal_week_header_add_event (GcalWeekHeader *self,
g_autoptr (GDateTime) week_start = NULL;
g_autoptr (GDateTime) week_end = NULL;
gboolean all_day;
- gint first_weekday;
gint start, end;
g_return_if_fail (GCAL_IS_WEEK_HEADER (self));
all_day = gcal_event_get_all_day (event);
- first_weekday = get_first_weekday ();
week_start = get_start_of_week (self->active_date);
week_end = get_end_of_week (self->active_date);
@@ -1632,13 +1630,13 @@ gcal_week_header_add_event (GcalWeekHeader *self,
/* Start position */
if (datetime_compare_date (start_date, week_start) >= 0)
- start = g_date_time_get_day_of_week (start_date) % 7 + first_weekday;
+ start = g_date_time_get_day_of_week (start_date) % 7;
else
start = 0;
/* End position */
if (g_date_time_compare (end_date, week_end) <= 0)
- end = (g_date_time_get_day_of_week (end_date) - all_day) % 7 + first_weekday;
+ end = (g_date_time_get_day_of_week (end_date) - all_day) % 7;
else
end = 6;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]