ISO calendar year != year

Bug #79825 reported by Marius Gedminas
8
Affects Status Importance Assigned to Milestone
SchoolTool
Confirmed
Wishlist
Unassigned

Bug Description

I discovered this bug while reading the source code.

datetime.isocalendar() returns (isoyear, isoweek, isoweekday). We use
isocalendar() to get isoweek in several places. In at least one place
(WeeklyView) we use self.cursor.year and self.cursor.isocalendar()[1] to get the
year and week numbers. This is wrong, since if Jan 1 is a Saturday (e.g.), the
first week in that year will nominally still be Week 53 of the *previous* year
rather than the current year.

Tags: calendar
Revision history for this message
Gintautas Miliauskas (gintas) wrote :

I agree that the current behaviour is not very clean, but I'm not sure how to
fix it. We could write 'Week 0' instead of 'Week 53', but do we really want to
do that? I'm strongly against showing the number of the previous year -- that
would be very confusing.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Go to
http://localhost:7080/persons/manager/calendar/weekly.html?date=2004-12-31
(note: I am doing this in the schoolbell-ui branch).

Observe the title: "December, 2004 (week 53)".

Click on Saturday, then click on the weekly view. You will be at
http://localhost:7080/persons/manager/calendar/weekly.html?date=2005-01-01 .
Note that you are looking at the exact same week.

Observe the title: "January, 2005 (week 53)".

I think that the title should be the same, given that we are looking at the same
week. The title should say "2004, week 53" and should not mention the month at all.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

This bug still exists in SB 1.0rc2:

Changed in schooltool:
importance: Low → Wishlist
status: In Progress → Confirmed
tags: added: calendar
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.