Fossil

View Ticket
Login

View Ticket

Ticket Hash: 774a1e7d735b61ed20fb2b062779182bed261c3c
Title: /reports?view=byweek should show week numbers starting at 1
Status: Closed Type: Feature_Request
Severity: Cosmetic Priority:
Subsystem: Resolution: Works_As_Designed
Last Modified: 2013-10-02 16:50:24
Version Found In: 1.27
User Comments:
nobody added on 2013-10-01 15:57:46:
While it's perfectly OK for software to start enumerating from 0, human calendar tradition starts calendaring at 1. I suspect that in the future (if not already) there could be small confusion with humans referring to week N of year Y when in fact current version refers to week N-1 of year Y. 

Example: /timeline?yw=2013-00&n=2000 shows week 0 of year 2013, which for a human corresponds to the first week of year 2013.

If it does not break current codebase, my suggestion is that this is resolved in favor of usual human interpretation (i.e. first week of the year is numeral 1, not 0).

stephan added on 2013-10-02 13:51:19:
The reason for this (admittedly confusing) behaviour is because the week number is calculated by sqlite3. Rather that "fudge" that calculation, it seems less problematic to use whatever sqlite3 feeds us.

The /reports and /timeline pages share this data (it's generated by /reports and consumed by /timeline), which means that any fudging of the result would have to be done in two places.

stephan added on 2013-10-02 16:50:24:
Addenda: it's also intuitive to us (insofar as ANYTHING about our calendar can be considered intuitive!) that a year has 52 weeks, but it's possible for a calendar week to have the value 53 even though the counting starts at 0. For example:

http://www.fossil-scm.org/fossil/reports?view=byweek&y=2007

There is no week 0 because fossil started in the middle of the year, but there is a week #53.

i'm not condoning this behaviour, just reporting it ;).