From df08daad68a833571110c3f5d1b2ec2804d769a6 Mon Sep 17 00:00:00 2001 From: Abdullahi Usman Date: Tue, 18 Jul 2017 14:30:57 +0100 Subject: [PATCH] month-view: improve dates calculation for RTL languages. Month view used to calculate the event's start date and end date from the physical layout of the month and compare it with the event's original start date and end date to see if there is a change and then update as necessary by either slanted start or end, when either is/are not equal to the one in the original start and end dates. However, the way in which the start date and end date in RTL language are calculated must be different since the layering of the days in the weeks are opposite. Month view uses precalculated days number to mirror the last week, which already chop off the days_delay number from cell_idx value. In RTL, this cause issues such that the days are calculated wrongly and a slanted start or end is visible. Because the date is not the same as the original events date, month view thinks that the view needs an update and so tries to update the view wrongly. We can fix this by using the cell_idx value to calculate the days and then substracting the days_delay value after that. https://bugzilla.gnome.org/show_bug.cgi?id=777426 --- src/views/gcal-month-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/gcal-month-view.c b/src/views/gcal-month-view.c index 5df47f34..3284a84c 100644 --- a/src/views/gcal-month-view.c +++ b/src/views/gcal-month-view.c @@ -1307,7 +1307,7 @@ gcal_month_view_size_allocate (GtkWidget *widget, /* Day number is calculated differently on RTL languages */ if (self->k) - day = 7 * row + MIRROR (day % 7, 0, 7) - length; + day = 7 * row + MIRROR (cell_idx % 7, 0, 7) - self->days_delay - length + 1; if (i != 0) {