6.0.0-beta1
7/13/25

[#1049] Weekday calculation error when "first weekday" set to Monday
Summary Weekday calculation error when "first weekday" set to Monday
Queue Kronolith
Queue Version 2.0
Type Bug
State Resolved
Priority 2. Medium
Owners chuck (at) horde (dot) org
Requester goncal.badenes (at) icfo (dot) es
Created 12/31/2004 (7499 days ago)
Due
Updated 01/04/2005 (7495 days ago)
Assigned 01/03/2005 (7496 days ago)
Resolved 01/04/2005 (7495 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/04/2005 04:03:36 AM Chuck Hagenbuch Comment #9
State ⇒ Resolved
Reply to this comment
Your patch looks good except for removing the $dayofweek = 0 line. 
I've committed the fix - thanks!
01/03/2005 11:16:46 PM goncal (dot) badenes (at) icfo (dot) es Comment #8
New Attachment: diff.txt Download
Reply to this comment
Your suggestion has made me find out that the problem only occurs if 
the "show calendars side by side" is also selected (which was the case 
for me!).



If my understanding is correct, the bug can then be tracked down to 
templates/month/head_side_by_side.inc, which does not take into 
account the offset in the day of the month if Monday has been chosen 
as the first weekday.



I have patched head_side_by_side.inc and everything seems to be 
working fine for me now. However, I would feel more confident if you 
could take a look at the patch (attached) and check whether this is 
the correct way of solving the problem and/or whether it would break 
something else.



Cheers,



     Gonçal
01/03/2005 12:18:31 AM Chuck Hagenbuch Comment #7
State ⇒ Feedback
Reply to this comment
Well, one way of looking at it is nothing is wrong with the weekday 
numbers, but only that the column labels are wrong - do events appear 
on the right day numbers?



Take a look in kronolith/templates/month/head.inc and see if you can 
see why the weekday generation is not starting with Monday.
01/03/2005 12:05:18 AM goncal (dot) badenes (at) icfo (dot) es Comment #6
New Attachment: calendar-bug.gif Download
Reply to this comment
Indeed, it makes no sense. That's why I think it's a bug. Although the 
"week starts on Monday" is selected, the month view still shows Sunday 
as the first day of the week, and the week day calculation is off by 
one day. I'm attaching a screen capture that shows what I get on the 
screen.

I can send you the config files if you wish. If I can help in any way 
to solve the problem please let me know. Sorry for the 
misunderstandings.
01/02/2005 11:28:18 PM Chuck Hagenbuch Comment #5
State ⇒ Not A Bug
Reply to this comment
This makes no sense:
Month view for February 2005 with the default "week starts on Sunday":
Sun30 Mon31 Tue1 Wed2 etc.

Month view for February 2005 with "week starts on Monday"
Sun31 Mon1 Tue2 Wed3 etc.
You're assuming that the first column is always Sunday - but it's not 
- look up. The whole point of "week starts on Monday" is that Monday 
is then the first day shown on the left, in the month and week views.
01/02/2005 09:17:50 PM goncal (dot) badenes (at) icfo (dot) es Comment #4 Reply to this comment
Sorry for being so vague in my bug report. After looking deeper into 
it I just realised that the problem *only* seems to appear in the 
*month view*.



Here goes the detailed description:



Month view for February 2005 with the default "week starts on Sunday":

Sun30 Mon31 Tue1 Wed2 etc.



Month view for February 2005 with "week starts on Monday" setting in 
the User Interface options:

Sun31 Mon1 Tue2 Wed3 etc.



Week and work week views are OK. Also, weekday calculation within the 
"create a new event" window is fine.
01/02/2005 04:51:06 PM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
Actually, I can't reproduce this. There's very little to indicate 
*where* you see this, so I don't know, but I suspect you didn't notice 
that you were in the wrong year - a problem I just fixed.
01/01/2005 06:21:58 PM Chuck Hagenbuch Comment #2
Assigned to Chuck Hagenbuch
State ⇒ Assigned
Reply to this comment
Confirmed in the week views; please be more specific in the future and 
also if you see this anyplace else.
12/31/2004 03:40:11 PM goncal (dot) badenes (at) icfo (dot) es Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Weekday calculation error when "first weekday" set to Monday
Queue ⇒ Kronolith
State ⇒ Unconfirmed
Reply to this comment
Weekdays, as shown in the calendars, are off by one day if I set 
"first weekday" to monday in my kronolith options. Everything goes 
back to normal if "first weekday" is set to sunday.


Saved Queries