calc: function WEEKNUM seems not to conform to ODFF1.2

Winfried Donkers W.Donkers at dci-electronics.nl
Thu Jun 7 04:21:01 PDT 2012


Hi Eike,

> I think this might be a plan:
> 
> * enhance WEEKNUM_ADD to support all ODF WEEKNUM modes
> * in the UI rename WEEKNUM to ISOWEEKNUM
> * change ISOWEEKNUM to accept only one parameter
> * during import's formula compile step for ISOWEEKNUM check if a second
>   argument is provided
>   * if so and if it is a constant value !=1 strip the argument (the
>     Monday case that was and is real ISO 8601)
>   * if it is a constant value ==1 map the function to WEEKNUM
>     * there's a slight chance that a user wanted exactly the behavior
>       "ISO but Sunday" resulting from the current undocumented
>       implementation details, which isn't supported by ODF WEEKNUM
>       definition, but I think that should be a very rare case, if at
>       all, and is neglectable
>   * if it is not a constant (i.e. computed) argument do nothing and let
>     the interpreter complain about the second parameter
> 
> I may have to help you with the compiler internals, give me a heads-up when
> you're stuck there.

My first reaction is, yes, a good plan and in line with what I wanted to do.
I will study your plan carefully, work on it step for step and keep you informed.
It looks as if after this plan has been executed, there will be two (in UI as well as ods-file) functions, WEEKNUM_ADD and ISOWEEKNUM, but WEEKNUM_ADD is not defined in ODFF and WEEKNUM is...
Shouldn't it be WEEKNUM in the UI and ods-file, and WEEKNUM_ADD in excel-files, to be renamed during export/import? (I haven't thought about implementation issues)

Winfried




More information about the LibreOffice mailing list