2.2: Week numbers in calendar wrong Posted by Atticus0307 05 Dec 2008 08:46 GMT-0000 posts: 7 Hi! 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. Where can I configure this? Thanks! Sascha
Posted by Atticus0307 09 Dec 2008 13:00 GMT-0000 posts: 7 Hi! Since no one cares to answer here, I did some digging myself. 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. Sascha