Milestone calendar display when first day of week is Monday

Project:ProjectPier
Version:0.8.5.0-Beta1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed - fixed
Description

The calendar view for milestones has dates off by one. That is, it shows Saturday, November 1, 2008, under the column for Sunday.

I am assigning this critical priority as the code is already in SVN. It must be fixed for the planned 0.8.5 release.

What's funny is that in the HTML code, the class of the th/td elements is correct per date. (e.g., November 1 & 2, 2008, have the CSS class "weekend"). It is just the layout that is off by one, not anything else, so far as I can tell.

Issue 28 comment #22 is the original bug report for this, but a new bug needed to be created. It looks like the original reporter (michel) never did that.

#1

Okay, the stupid easy fix is to change the language file so that 'dow 1' => 'Sunday', 'dow 2' => 'Monday', etc. I don't see any issues with doing this, and I believe that is how the original patch author thought things were. It looks like the language files were just created at a different time and someone forgot the rule. :)

I'll have a patch shortly that will fix the language file as well as simplify the calculation of whether or not a date is a weekend and add an option to the "General" configuration section to specify the first day of the week.

#2

Here's a patch. This fixes the language file, changes the "weekend date" detection to make it much simpler, and adds the DayOfWeekConfigHandler class and initial data to make configuration possible (it's in the "General" configuration section).

Only thing left to do is add something to the upgrade script to add this config field. During the IRC dev meeting on 2008/11/11, we talked about creating an upgrade script placeholder for this kind of stuff. For the time being, I am marking this as "patch - code needs review" and am going to create another bug to track the need for an addition to the upgrade script for this configuration.

Hopefully since the changes are very minimal in this patch, this will be reviewed, accepted, and committed quickly.

AttachmentSize
calendar_dow_fix.patch 11.59 KB
#3
Status:new» closed - fixed

Accepted in 0.8.6