Opened 14 years ago

Closed 10 years ago

#6241 closed defect (patchwelcome) Week 53 in 2007?

Reported by: guest Owned by: Adam Peller
Priority: high Milestone: future
Component: Dojox Version: 1.1b1
Keywords: week number, date, iso8601, posix, getIsoWeekOfYear Cc: [email protected]
Blocked By: Blocking:

Description (last modified by Adam Peller)

There seems to be a mismatch between dokumentation and code in handling of getIsoWeekOfYear.

getIsoWeekOfYear gives week number 53 for Monday, December 31, 2007. tests/posix.js validates this behavior:

	week = Date(2007,11,31));, week);
	week = Date(2008,0,1));, week);

The documentation however says that

	//   The week containing January 4th is the first week of the year.

According to Wikipedia

The following years have 53 weeks:
    * years starting with Thursday
    * leap years starting with Wednesday


The ISO year starts at the first day (Monday) of
week 01 and ends at the Sunday before the new 
ISO year (hence without overlap or gap)

Whereas in the current implementation, the first week of 2008 seems to begin on Tuesday.

Change History (2)

comment:1 Changed 14 years ago by Adam Peller

Description: modified (diff)
Milestone: future

The ISO code is very old and never followed the spec. Would welcome patches for the ISO date code. No cycles for it atm.

comment:2 Changed 10 years ago by Adam Peller

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.