Ticket #6241 (new defect)
dojox.date.posix.getIsoWeekOfYear: Week 53 in 2007?
| Reported by: | guest | Owned by: | peller |
|---|---|---|---|
| Priority: | normal | Milestone: | future |
| Component: | Dojox | Version: | 1.1b1 |
| Severity: | normal | Keywords: | week number, date, iso8601, posix, getIsoWeekOfYear |
| Cc: | haavikko@… |
Description (last modified by peller) (diff)
There seems to be a mismatch between dokumentation and code in dojox.date.posix handling of getIsoWeekOfYear.
getIsoWeekOfYear gives week number 53 for Monday, December 31, 2007. tests/posix.js validates this behavior:
week = dojox.date.posix.getIsoWeekOfYear(new Date(2007,11,31)); t.is(53, week); week = dojox.date.posix.getIsoWeekOfYear(new Date(2008,0,1)); t.is(1, week);
The documentation however says that
// The week containing January 4th is the first week of the year.
According to Wikipedia http://en.wikipedia.org/wiki/ISO_week_date:
The following years have 53 weeks:
* years starting with Thursday
* leap years starting with Wednesday
Also: http://en.wikipedia.org/wiki/ISO_8601
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
Note: See
TracTickets for help on using
tickets.