I am using calendar module 5.x-1.7. Apparently the "Week" view in calendar is still disabled because of the difficulty in getting ISO 8601 week numbers correct.

It occurred to me we can just query the database for this, no?

For example the sql function Week('2007-01-01') should return 0. I'd trust the DB logic more than I trust any 'new' code. Why can't we not re-invent the wheel and leverage existing code that's been tested to work?

Comments

KarenS’s picture

Status: Active » Fixed

That won't work because it will give you the ISO week, not the calendar week, and the calendar week will be different depending on what day your week starts on. It is a very complicated problem.

This should be fixed in the 5.2 version, which is not quite ready for an official release. You can see that release if you look for 'other releases' on the project page. Try it in a test environment, or be prepared to update it as bugs are found and fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.