Loading...
 
Skip to main content

Calendar shows wrong week numbers

Status
Closed
Subject
Calendar shows wrong week numbers
Category
  • Error
Feature
Calendar
Resolution status
New
Submitted by
Atticus0307
Lastmod by
Landry Bitege
Rating
(0)
Description

This issue was reported here:
http://tikiwiki.org/tiki-view_forum_thread.php?comments_parentId=31232&topics_offset=2&topics_sort_mode=lastPost_desc&forumId=4Question

Here in Germany, and most likely in other parts of the world as well, we use an ISO based week numbering system.

The Calendar display the week starting Monday, January 5th 2009 as week 1, while in fact, as least here, week 1 starts on December 29th.

TW seems to use Date.getWeekOfYear() to get the week number. That must be considered a bug, since that doesn't take locales into account.
Instead, TW should use strftime with %U, %V or %W, depending on the locale or depending on settings.

This is backed by PHP "bugs" 19719 and 14422 for example, which were identified as not being bugs at all. The docs of Date are not very clear on what getWeekOfYear() really returns. Both bug entries show how to determine the week number correctly.

Solution

Use strftime with %U, %V or %W, depending on the locale or depending on settings.
It would be nice to have a configuration somewhere in Admin Calendar for this.

Workaround
Importance
4
Priority
20
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2212
Created
Tuesday 09 December, 2008 18:08:59 UTC
by Unknown
LastModif
Tuesday 14 April, 2026 21:09:22 UTC


Show PHP error messages