Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

Whilst working on function ISOWEEKNUM (fdo 50488), I found that function WEEKNUM has a different 
behaviour as defined in ODFF1.2.
The difference is in interpreting parameter Mode:

ODF1.2 states: 
(default value for Mode = 1)
Constraints: 1 ≤ Mode ≤ 2, or 11 ≤ Mode ≤ 17, or Mode = 21, or Mode = 150
For Mode={1, 2, 11, 12, ..., 17} the week containing January 1 is the first week of the year, and 
is numbered week 1. The week starts on {Sunday, Monday, Monday, Tuesday, ..., Sunday}.
Mode 21 or 150 are both [ISO8601], the week starts on Monday and the week containing the first 
Thursday of the year is the first week of the year, and is numbered week 1.

calc uses the following:
Mode = 1 :  Sunday is first day of week
Mode != 1 : Monday is first day of week
Definition of when week 1 starts is always as in ISO 8601.

I would like to change the behaviour of function WEEKNUM to conform to ODFF1.2 
(core/tools/source/datetime/tdate.cxx, Date::GetWeekOfYear(..) allows this), but before enter a bug 
and start working on it, I would like to hear if there are reasons to keep WEEKNUM as it is (and 
change the documentation to state that the function differs from ODFF1.2).



Winfried



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.