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

Eike Rathke erack at redhat.com
Thu Jun 7 03:57:31 PDT 2012


Hi Winfried,

On Thursday, 2012-06-07 09:23:47 +0200, Winfried Donkers wrote:

> I will work on strictly implementing ODFF for WEEKNUM and ISOWEEKNUM.
> I don't know if I will find a way to produce an error message explaining to the user what exactly is wrong when opening old files with WEEKNUM in it.

The wording of your comment
https://bugs.freedesktop.org/show_bug.cgi?id=50488#c3
sounds as if you plan to add another function with the name ISOWEEKNUM
in the UI. Note that confusingly we already have two functions, WEEKNUM
in UI saved as ISOWEEKNUM in ODF and WEEKNUM_ADD (which is the Excel
WEEKNUM) in UI saved as WEEKNUM in ODF.

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.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120607/75d820cb/attachment.pgp>


More information about the LibreOffice mailing list