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 305022 - Calendar does not mark the last day for an appointment spanning multiple days
Calendar does not mark the last day for an appointment spanning multiple days
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: clock
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-21 17:37 UTC by Mads D. Kristensen
Modified: 2007-01-17 21:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
fixes bug (734 bytes, patch)
2006-04-18 00:25 UTC, Michael Frank
committed Details | Review

Description Mads D. Kristensen 2005-05-21 17:37:53 UTC
Version details: 2.10.1/2.10.0
Distribution/Version: Ubuntu 5.04 / gentoo 2005.0

1) Create an appointment that spans multiple days.
2) Click the calendar and navigate to the month that contains the appointment.
3) Now you can see that the last day of the appointment is not marked (bold).
Comment 1 Mads D. Kristensen 2005-05-21 21:11:22 UTC
Here is a patch (against the 2.10.1 version - but it should apply to the latest
version in cvs) that should fix the problem. I have not tested this patch yet
but I will as soon as I get the time.

diff calendar-client.c gnome-panel-2.10.1/applets/clock/calendar-client.c
1829,1841d1828
< static inline int
< same_month (time_t t1, time_t t2) {
<   struct tm *tm;
<   int t1_mon, t1_year;
<
<   tm = localtime(&t1);
<   t1_mon = tm->tm_mon;
<   t1_year = tm->tm_year;
<   tm = localtime(&t2);
<
<   return (t1_mon == tm->tm_mon && t1_year == tm->tm_year);
< }
<
1884,1897c1871,1872
<             int duration;
<
<             if (same_month (appointment->start_time, appointment->end_time))
<               {
<                 duration = day_from_time_t (appointment->end_time) -
<                            day_from_time_t (appointment->start_time);
<               }
<             else
<               {
<                 duration = day_from_time_t (month_end) -
<                            day_from_time_t (appointment->start_time);
<               }
<
<               for (day_offset = 1; day_offset <= duration / 86400; day_offset++)
---
>               int duration = appointment->end_time - appointment->start_time;
>               for (day_offset = 1; day_offset < duration / 86400; day_offset++)
Comment 2 Sebastien Bacher 2005-07-17 01:49:02 UTC
Thanks for your bug/patch. Usually patches are made with the "-u" option and
attached as a file to the bug. The patch seems to be reversed too. Could you
attach a patch made with "diff -u" to the bug with some explanation of what you
changed for the maintainers?

I don't get this bug here. Is the appointement using the whole day? Do you use
the same timezone setting for evolution and GNOME?
Comment 3 Michael Frank 2006-04-18 00:25:10 UTC
Created attachment 63760 [details] [review]
fixes bug

took the existing patch above and turned it into a unified diff attachment.  tested it on my machine and it works.
Comment 4 Henning C. Nielsen 2006-04-18 19:11:45 UTC
This seems to be fixed in Clock 2.14.0 and Evolution 2.6.0.

I can reproduce the bug on older versions but not on these versions.
Comment 5 Vincent Untz 2007-01-17 20:33:18 UTC
Michael: do you still need this patch? Seems to work fine for me too.
Comment 6 Vincent Untz 2007-01-17 20:41:07 UTC
Oops, can reproduce.
Comment 7 Vincent Untz 2007-01-17 21:03:26 UTC
Committed.