GNOME Bugzilla – Bug 772100
Setting time may make the event date span backward
Last modified: 2017-11-24 21:58:10 UTC
Created attachment 336415 [details] Calendar new event creation (video) Setting a time for an 'All day' event may make the event dated backward. This seems to happen only for single day events. See the attached screencast (The event is added on 29th Sept, when time is set, the end date sets to 28th)
Created attachment 343786 [details] Reproduced bug report, with further observations.
Created attachment 346258 [details] [review] edit-dialog: fix date span backward The problem is that the end date might change to one before the start date when modifying the start time. Treat some cases taking into consideration the start date and start time related to the fact that an event is spanning all day or not. Separate the handling of the start date and start time.
Thanks for the patch! Attachment 346258 [details] pushed as 1228f05 - edit-dialog: fix date span backward
Sorry, this was a mistake. I reverted the patch, and will review it properly.
(In reply to Georges Basile Stavracas Neto from comment #4) > Sorry, this was a mistake. I reverted the patch, and will review it properly. No problem. I'm waiting for the review.
Created attachment 347676 [details] [review] Fix the date spanning backwards in the edit-dialog
(In reply to Utkarsh Maheshwari from comment #6) > Created attachment 347676 [details] [review] [review] > Fix the date spanning backwards in the edit-dialog I think this might solve the problem. This is my first attempt for gnome-calendar. Waiting eagerly for review... :)
Review of attachment 347676 [details] [review]: This is wrong. It leaks whatever GDateTime was set before, and doesn't solve the real cause of the problem. I suspect the real issue is at GcalDateChooser.
Created attachment 356992 [details] [review] changed sync_datetimes function to fix the problem
Created attachment 357045 [details] [review] have made some changes to sync_datetimes function to fix the problem I would be happy if someone can apply the patch and see if it doesn't break anything. I couldn't find any other place to make changes than sync_datetimes function. If it isn't the correct place, I am ready to dig further.
Review of attachment 357045 [details] [review]: Your patch is missing a commit message, and thus cannot be applied. Other than that, and the comments below, it looks good! What do you think about helping porting the time selector widgets to GtkEntry? :) ::: src/gcal-edit-dialog.c @@ +391,3 @@ */ + start_local = g_date_time_to_local(start); + end_local = g_date_time_to_local(end); Wrong style (needs space before parenthesis). @@ +404,3 @@ else { + new_date = g_date_time_add_hours (end_local, -(hour_to_add)); No need to wrap hour_to_add in parenthesis
Created attachment 357957 [details] [review] Patch to fix the problem thanks Georges, I have made the suggested changes and have written a commit message as well. I don't mind commit_message/code being edited before being committed. And as I am pretty much new to GNOME, I am not sure how much of help I might be. But I am planning to stick around and contribute whatever I can.
Review of attachment 357957 [details] [review]: there is a minor bug in the patch though. It shouldn't convert an all_day_event to local timezone.
(In reply to newtodisworld from comment #12) > thanks Georges, I have made the suggested changes and have written a commit > message as well. I don't mind commit_message/code being edited before being > committed. Cool. > And as I am pretty much new to GNOME, I am not sure how much of help I might > be. But I am planning to stick around and contribute whatever I can. You're free to contribute as much as you want, wherever you want =)
Created attachment 358046 [details] [review] Proposed patch taking into account all day events I have taken into account all day events as well. Please review the patch.
I'll fix the remaining style issues with the patch, and push it. Thanks for the patch.
Thanks for the patch.
Reopening. This has been fixed only in the UI. The event saved is still off by Time zone. This can be reproduced by creating the event in gnome-calendar and checking them in gnome-shell events list or evolution.
(In reply to Mohammed Sadiq from comment #18) > Reopening. This has been fixed only in the UI. The event saved is still off > by Time zone. > > This can be reproduced by creating the event in gnome-calendar and checking > them in gnome-shell events list or evolution. Thanks Sadiq for the comment. I will look into it.
(In reply to Mohammed Sadiq from comment #18) > Reopening. This has been fixed only in the UI. The event saved is still off > by Time zone. > > This can be reproduced by creating the event in gnome-calendar and checking > them in gnome-shell events list or evolution. Hi Sadiq, Can you please confirm if the problem existed before the fix or got introduced by the fix? Amandeep
(In reply to newtodisworld from comment #20) > Hi Sadiq, Hi > Can you please confirm if the problem existed before the fix or got > introduced by the fix? It is present in 3.22.4. So I believe it existed long back.
(In reply to Mohammed Sadiq from comment #21) > (In reply to newtodisworld from comment #20) > > Hi Sadiq, > Hi > > > Can you please confirm if the problem existed before the fix or got > > introduced by the fix? > > It is present in 3.22.4. So I believe it existed long back. Hi Sadiq, The issue of event being saved off by Timezone is a different issue than event day spanning backwards. So, in my opinion a new bug should be opened to track this issue and this one should be closed.
Created attachment 360241 [details] [review] Fix for the timezone issue Whenever user toggles All Day Check Box, the timezone of the event should be changed to UTC or LMT as the case may be. I am not sure though, if we need to consider any other TimeZone.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-calendar/issues/74.