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 372155 - Calendar opens Evolution on the wrong day
Calendar opens Evolution on the wrong day
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: clock
2.22.x
Other Linux
: Normal minor
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 499374 537743 (view as bug list)
Depends on: 409200
Blocks:
 
 
Reported: 2006-11-07 19:55 UTC by Sven Arvidsson
Modified: 2008-09-01 22:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
calculate UTC time for evolution call (950 bytes, patch)
2007-12-01 19:53 UTC, Matthias Drochner
none Details | Review
patch as in comment #6, updated for gnome-panel-2.22.1.3 (1.22 KB, patch)
2008-04-16 17:01 UTC, Matthias Drochner
none Details | Review
make clock applet open correct date in evolution's calendar (1.43 KB, patch)
2008-08-04 22:38 UTC, Paul Bolle
committed Details | Review

Description Sven Arvidsson 2006-11-07 19:55:25 UTC
This bug was reported to the Debian BTS.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=366970

"According to upstream's NEWS this release of GNOME Panel can open an Evolution calendar on the day clicked in the clock applet's calendar. Well, it seems that Evolution is being opened on the day before to the one picked. Go figure."

The submitter gets the same result using both locale es_AR.UTF-8 and POSIX/C if it matters.
Comment 1 Matt Kraai 2007-02-15 10:52:45 UTC
If the local timezone is a negative offset from UTC, the date and time that is passed to Evolution, which is the date and time that the selected day starts in UTC, is during the previous day in the local timezone, so Evolution opens on the previous day.
Comment 2 Vincent Untz 2007-02-18 08:45:55 UTC
The current version of evolution can't correctly parse ISO 9601 dates, which blocks this.
Comment 3 Matt Kraai 2007-04-01 17:36:39 UTC
Is there a bug report against (In reply to comment #2)
> The current version of evolution can't correctly parse ISO 9601 dates, which
> blocks this.

Is there a bug filed against Evolution that reports this?  The only related one I found was bug #341348, which doesn't mention this problem (though it refers to bug #162305, which is fixed but does mention this problem).
Comment 4 Vincent Untz 2007-04-01 19:57:27 UTC
That's bug 409200 (this bug depends on bug 409200)
Comment 5 Matthias Drochner 2007-12-01 19:51:33 UTC
So if evolution does only parse UTC dates and it is unknown whether
this will change soon, how about passing a correct UTC time which
corresponds to the beginning of that day in my local time zone?
I'll attach a patch. It got some light testing in NetBSD/pkgsrc.
(The idea is similar to the Ubuntu patch, see
https://bugs.launchpad.net/evolution/+bug/42115
)
Comment 6 Matthias Drochner 2007-12-01 19:53:51 UTC
Created attachment 99996 [details] [review]
calculate UTC time for evolution call
Comment 7 Juan Rodriguez 2008-03-26 20:02:26 UTC
Bug still happens in Gnome 2.22. 
It opens Evolution's Calendar one day before the date clicked. 
Comment 8 Vincent Untz 2008-04-07 10:44:38 UTC
*** Bug 499374 has been marked as a duplicate of this bug. ***
Comment 9 Vincent Untz 2008-04-07 12:32:30 UTC
I've fixed it in a similar way. This will break when bug 409200 is resolved, though...
Comment 10 Matthias Drochner 2008-04-16 16:00:20 UTC
The fix (which is in gnome-panel-2.22.1.3) doesn't work in all situations:
If the utc and local dates differ, the offset for the hour printed out
will wrap over.
Eg: I'm in GMT+2, and shortly after midnight utc_tm.tm_hour is 23, and
local_tm.tm_hour is 1, so the time passed to evolution will be T340000.
Comment 11 Matthias Drochner 2008-04-16 17:01:23 UTC
Created attachment 109375 [details] [review]
patch as in comment #6, updated for gnome-panel-2.22.1.3
Comment 12 Vincent Untz 2008-06-30 15:03:18 UTC
*** Bug 537743 has been marked as a duplicate of this bug. ***
Comment 13 Paul Bolle 2008-08-04 22:38:23 UTC
Created attachment 115863 [details] [review]
make clock applet open correct date in evolution's calendar

The analysis of Matthias Drochner in comment #10 is entirely correct. This bug should be reopened (why can't I do that?). Commit 10988 is not correct and can still (and easily) lead to opening up the calendar on a wrong date.

As it turns out I've been spending some time recreating what Matthias already had done in comment #6 and comment #11. Attached is basically the same solution, just a few minor differences (a few casts, avoided bzero(), variable names), done for current trunk, tested against 2.22.2. Matthias deserves credits, as he provided the correct solution eight months ago!
Comment 14 Rémi Cardona 2008-08-25 08:13:38 UTC
Ping here? Is this really fix or should Paul's patch from comment #13 be applied?

Thanks
Comment 15 Matthias Drochner 2008-08-26 18:14:42 UTC
Afaict the current date/time calculation can still overflow, as described
in comment #10. So a fix is necessary. Paul's patch looks fine, and is
technically identical to the one I've been testing for many months (although
only in one timezone).
Comment 16 Paul Bolle 2008-08-27 00:16:36 UTC
Add myself to cc list (somehow didn't do that before, I suppose).

While I'm spamming anyway, and rather off topic: why can't third parties reopen bugs? Is there some benefit in disallowing that?
Comment 17 Vincent Untz 2008-09-01 22:59:14 UTC
Thanks, patch committed.

(In reply to comment #16)
> Add myself to cc list (somehow didn't do that before, I suppose).
> 
> While I'm spamming anyway, and rather off topic: why can't third parties reopen
> bugs? Is there some benefit in disallowing that?

You just need to ask for permissions on #bugs. We don't do it by default to be a bit more secure, I guess.