After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769300 - Multi all days events end one day too soon
Multi all days events end one day too soon
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: General
3.20.x
Other Linux
: Normal normal
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-29 12:06 UTC by jeremy9856
Modified: 2017-04-17 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
event: fix _is_multiday() (886 bytes, patch)
2016-07-29 14:39 UTC, Ernestas Kulik
none Details | Review
month-view: fix multi-day event width allocation (1.18 KB, patch)
2016-07-29 14:39 UTC, Ernestas Kulik
none Details | Review
month-view: fix all-day multi-day event width allocation (1.19 KB, patch)
2016-07-29 14:41 UTC, Ernestas Kulik
none Details | Review
edit-dialog: fake inclusive end of all-day multi-day events (1.83 KB, patch)
2016-08-01 21:48 UTC, Ernestas Kulik
none Details | Review
edit-dialog: fake inclusive end date for all-day events (2.23 KB, patch)
2016-08-03 13:29 UTC, Ernestas Kulik
committed Details | Review

Description jeremy9856 2016-07-29 12:06:50 UTC
Hello,

Multi all days events ends one day too soon :

- Create a new event (eg. august 14th)
- Check all day
- Set ending one day (or more) after the staring day (eg. august 15th)

=> The multi all days events ends one day too soon (eg. august 14th)

Thanks !
Comment 1 Ernestas Kulik 2016-07-29 14:14:28 UTC
From what I see, only events, spanning two days, are broken.
Comment 2 Ernestas Kulik 2016-07-29 14:28:44 UTC
(In reply to Ernestas Kulik from comment #1)
> From what I see, only events, spanning two days, are broken.

Okay, nevermind. I forgot to mark them as all day events.
Comment 3 Ernestas Kulik 2016-07-29 14:39:34 UTC
Created attachment 332354 [details] [review]
event: fix _is_multiday()

The day difference of all-day events must be zero for them to be not
considered multi-day events. This commit changes the logic of the
function to reflect that.
Comment 4 Ernestas Kulik 2016-07-29 14:39:39 UTC
Created attachment 332355 [details] [review]
month-view: fix multi-day event width allocation

Multi-day events are rendered as if they end the day prior to the actual
end day. This commit removes the code that makes it so.
Comment 5 Ernestas Kulik 2016-07-29 14:41:36 UTC
Created attachment 332356 [details] [review]
month-view: fix all-day multi-day event width allocation

All-day multi-day events are rendered as if they end the day prior to
the actual end day. This commit removes the code that makes it so.
Comment 6 jeremy9856 2016-07-29 17:38:14 UTC
Thanks Ernestas ! Something else, Calendar crash sometimes, how can I get some debug info to open an issue ?
Comment 7 Ernestas Kulik 2016-07-29 18:33:50 UTC
(In reply to jeremy9856 from comment #6)
> Thanks Ernestas ! Something else, Calendar crash sometimes, how can I get
> some debug info to open an issue ?

This should get you going:
https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces
Comment 8 jeremy9856 2016-07-29 22:06:21 UTC
Thanks !
Comment 9 Georges Basile Stavracas Neto 2016-08-01 20:37:13 UTC
Review of attachment 332356 [details] [review]:

This is the intended behavior. The ICalendar protocol defines an all-day event this way.

I believe the best solution we have here is faking the end date on the Edit dialog to show 1 day before the real end date is (only when it's an all-day event, obviously).
Comment 10 Georges Basile Stavracas Neto 2016-08-01 20:38:23 UTC
Review of attachment 332354 [details] [review]:

This is correct, according to iCalendar protocol. We only have to fake the end date on Edit dialog.
Comment 11 Ernestas Kulik 2016-08-01 21:48:22 UTC
Created attachment 332494 [details] [review]
edit-dialog: fake inclusive end of all-day multi-day events

Currently, all-day multi-day events are displayed inconsistently with
regard to other calendar applications. That is due to strict following
of RFC 5545, which mandates non-inclusive all-day multi-day event end
dates. This commit makes the edit dialog display a faked date for such
events.
Comment 12 Ernestas Kulik 2016-08-01 21:49:20 UTC
Argh, messed the subject line up a bit. But it should be something like that, no?
Comment 13 Georges Basile Stavracas Neto 2016-08-01 21:59:37 UTC
Review of attachment 332494 [details] [review]:

Only aesthetic changes, good work.

::: src/gcal-edit-dialog.c
@@ +596,3 @@
       end_date = gcal_edit_dialog_get_date_end (dialog);
 
+      if (all_day)

Please add a comment explaining why this is needed here. I'm pretty sure I'll see this code in the future and wonder why it's here :)

@@ +600,3 @@
+          GDateTime *fake_end_date = g_date_time_add_days (end_date, 1);
+
+          g_date_time_unref (end_date);

Use g_clear_pointer (&end_date, g_date_time_unref);
Comment 14 Ernestas Kulik 2016-08-02 07:57:41 UTC
I have realized that the patch breaks existing single-day events (they all are shown to end before they start). This can be worked around in gcal_event_set_component_internal() by the same means, i.e. adding one day if the start and end dates are equal.

Should the patch include it or do we break stuff?
Comment 15 Ernestas Kulik 2016-08-03 13:29:55 UTC
Created attachment 332620 [details] [review]
edit-dialog: fake inclusive end date for all-day events

Currently, all-day multi-day events are displayed inconsistently with
regard to other calendar applications. That is due to strict following
of RFC 5545, which mandates non-inclusive all-day multi-day event end
dates. This commit makes the edit dialog display a faked date for such
events.
Comment 16 Georges Basile Stavracas Neto 2016-08-03 13:36:16 UTC
Review of attachment 332620 [details] [review]:

Sure.
Comment 17 Ernestas Kulik 2016-08-03 13:41:46 UTC
Attachment 332620 [details] pushed as 46a05e5 - edit-dialog: fake inclusive end date for all-day events
Comment 18 jeremy9856 2016-08-03 14:40:53 UTC
Thanks !
Comment 19 jeremy9856 2016-08-18 14:38:28 UTC
Is it possible to have the fix backported to v3.20 please ?
Comment 20 jeremy9856 2016-09-16 07:49:52 UTC
So no backport to 3.20 ?