Bug 258866

Summary: Month view span does not get updated before the first Monday of the month.
Product: [Applications] korganizer Reporter: oncelacar
Component: generalAssignee: Sergio Martins <smartins>
Status: RESOLVED FIXED    
Severity: normal CC: smartins
Priority: NOR    
Version: 4.4.5   
Target Milestone: ---   
Platform: PiSi Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: On 05.12.2010, when Kontact has just started
Again on 05.12.2010, this time after scrolling away within the month view and then clicking the home button
This time on 06.12.2010

Description oncelacar 2010-12-05 01:40:27 UTC
Version:           4.4.5 (using KDE 4.4.5) 
OS:                Linux

The month view of KOrganizer, which is meant to span completely the month containing the current day, displays the previous month on the first few days of the month, if the first Monday of the current month has not been reached yet.

Reproducible: Always

Steps to Reproduce:
Start KOrganizer
Switch to month view
Click the "Today" button in the toolbar

Actual Results:  
No problems with the operation of the software. It just displays the wrong month.

Expected Results:  
The month view should display the current month when the "Today" button is pressed, even if the current week might have started in the previous month.

OS: Linux (i686) release 2.6.31.13-131
Compiler: i686-pc-linux-gnu-gcc
Comment 1 Sergio Martins 2010-12-31 00:54:29 UTC
Can you show me a printscreen ?
Comment 2 oncelacar 2011-01-02 21:14:44 UTC
Created attachment 55486 [details]
On 05.12.2010, when Kontact has just started
Comment 3 oncelacar 2011-01-02 21:19:03 UTC
Created attachment 55487 [details]
Again on 05.12.2010, this time after scrolling away within the month view and then clicking the home button
Comment 4 oncelacar 2011-01-02 21:20:37 UTC
Created attachment 55488 [details]
This time on 06.12.2010
Comment 5 oncelacar 2011-01-02 21:39:34 UTC
Preliminary information: "Kasım" is November and "Aralık" is December.

The condition for the error to appear is that the current date has to be within a week that had started in the previous month. Choosing the first week of December 2010 as an example, I temporarily set my system date to from 01.12.2010 to 06.12.2010, one by one.

On the first five days of December (01-05.12.2010), since the week had started in November (29.11.2010, Monday), when Kontact first starts, it looks like in https://bugs.kde.org/attachment.cgi?id=55486. Here both the month view's span and the smaller month calendar's (upper left) span display November, and not December.

Then I scroll away (any direction) from that view, and select some day within another month by clicking on it in the month view. The month view displays the month containing this selected day. When I click the "Home" button, the selected day is reset to my computer's system date (let's say 05.12.2010), and the month view display should change to span whole December. I changes, however spans whole November, and not whole December. However, this time that small calendar (top left) spans the right month. See https://bugs.kde.org/attachment.cgi?id=55487.

After that problematic week is over, i.e. starting from 06.12.2010, everything is as expected, as seen on https://bugs.kde.org/attachment.cgi?id=55488.

I hope I have managed to make things clear. If not please feel free to ask.

Thanks for your concern.
Comment 6 oncelacar 2011-02-06 13:17:38 UTC
Any updates here? Can someone confirm the bug?
Comment 7 Sergio Martins 2011-02-08 09:43:04 UTC
Git commit c4dd89e6f866f895ec50763049b39e0d72902154 by Sergio Martins.
Committed on 08/02/11 at 09:33.
Pushed by smartins into branch 'master'.

EventViews::showDates() and setDateRange() now have an optional "preferredMonth" parameter.

For month-like views, this hint will be used to choose the correct month when the date range crosses months.

CCBUG: 258866

M  +2    -1    calendarviews/eventviews/agenda/agendaview.cpp     
M  +1    -1    calendarviews/eventviews/agenda/agendaview.h     
M  +7    -11   calendarviews/eventviews/eventview.cpp     
M  +16   -5    calendarviews/eventviews/eventview.h     
M  +2    -1    calendarviews/eventviews/list/listview.cpp     
M  +1    -1    calendarviews/eventviews/list/listview.h     
M  +8    -4    calendarviews/eventviews/month/monthview.cpp     
M  +4    -3    calendarviews/eventviews/month/monthview.h     
M  +2    -1    calendarviews/eventviews/multiagenda/multiagendaview.cpp     
M  +1    -1    calendarviews/eventviews/multiagenda/multiagendaview.h     
M  +2    -1    calendarviews/eventviews/timeline/timelineview.cpp     
M  +1    -1    calendarviews/eventviews/timeline/timelineview.h     
M  +6    -8    korganizer/interfaces/korganizer/baseview.cpp     
M  +3    -3    korganizer/interfaces/korganizer/baseview.h     
M  +2    -2    korganizer/views/agendaview/koagendaview.cpp     
M  +2    -2    korganizer/views/agendaview/koagendaview.h     
M  +1    -1    korganizer/views/journalview/kojournalview.cpp     
M  +1    -1    korganizer/views/journalview/kojournalview.h     
M  +1    -1    korganizer/views/listview/kolistview.cpp     
M  +1    -1    korganizer/views/listview/kolistview.h     
M  +2    -2    korganizer/views/monthview/monthview.cpp     
M  +2    -2    korganizer/views/monthview/monthview.h     
M  +2    -2    korganizer/views/multiagendaview/multiagendaview.cpp     
M  +2    -2    korganizer/views/multiagendaview/multiagendaview.h     
M  +1    -1    korganizer/views/timelineview/kotimelineview.cpp     
M  +1    -1    korganizer/views/timelineview/kotimelineview.h     
M  +1    -1    korganizer/views/timespentview/kotimespentview.cpp     
M  +1    -1    korganizer/views/timespentview/kotimespentview.h     
M  +1    -1    korganizer/views/todoview/kotodoview.cpp     
M  +1    -1    korganizer/views/todoview/kotodoview.h     
M  +1    -1    korganizer/views/whatsnextview/kowhatsnextview.cpp     
M  +1    -1    korganizer/views/whatsnextview/kowhatsnextview.h     

http://commits.kde.org/kdepim/c4dd89e6f866f895ec50763049b39e0d72902154
Comment 8 Sergio Martins 2011-02-09 01:09:39 UTC
Git commit bb47d4ba4fa7a1daa84136b72b25e3e7c51dfb83 by Sergio Martins.
Committed on 09/02/11 at 01:06.
Pushed by smartins into branch 'master'.

Clicking on a week number will select the correct month in month view.

CCBUG: 258866

M  +2    -3    calendarviews/eventviews/month/monthview.cpp     
M  +4    -3    korganizer/calendarview.cpp     
M  +1    -1    korganizer/calendarview.h     
M  +2    -2    korganizer/koviewmanager.cpp     
M  +1    -1    korganizer/koviewmanager.h     

http://commits.kde.org/kdepim/bb47d4ba4fa7a1daa84136b72b25e3e7c51dfb83
Comment 9 Sergio Martins 2011-02-09 01:52:11 UTC
Git commit 4612818aa488234ea6ba879a2e27121975cb843e by Sergio Martins.
Committed on 09/02/11 at 01:46.
Pushed by smartins into branch 'master'.

Added the "preferredMonth" to the datesSelected() signal too.

The view now has an hint of which month to display when a week crosses two months.

Clicking on a date navigator date now keeps month view in sync.

CCBUG: 258866

M  +2    -2    korganizer/calendarview.cpp     
M  +2    -2    korganizer/datenavigator.cpp     
M  +1    -1    korganizer/datenavigator.h     
M  +10   -1    korganizer/datenavigatorcontainer.cpp     
M  +4    -1    korganizer/datenavigatorcontainer.h     

http://commits.kde.org/kdepim/4612818aa488234ea6ba879a2e27121975cb843e
Comment 10 Sergio Martins 2011-02-09 23:43:13 UTC
Git commit 420c0ad7a71a318608cb710cf0d9783f717bba5a by Sergio Martins.
Committed on 09/02/2011 at 23:36.
Pushed by smartins into branch 'master'.

Fix the last bug related to the selection crossing months.

I already fixed this bug some months ago, but it was for the navigator's back/forward arrows.
Now its fixed for the toolbar's Forward/Backward actions too.

BUG: 258866

M  +7    -2    korganizer/calendarview.cpp     
M  +0    -1    korganizer/datenavigator.cpp     

http://commits.kde.org/kdepim/420c0ad7a71a318608cb710cf0d9783f717bba5a