Summary: | LibreOffice counts weeknumbers wrong, starting in 2021... | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Marqeaux <Marceaux> |
Component: | Calc | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | RESOLVED NOTABUG | ||
Severity: | normal | CC: | rb.henschel, srdosm |
Priority: | medium | Keywords: | preBibisect |
Version: | Inherited From OOo | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Attachments: | See the mismatch in week numbering |
Description
Marqeaux
2020-12-31 15:17:37 UTC
Created attachment 168605 [details]
See the mismatch in week numbering
Week number 53 in 2020 is shown as week 1 in 2021. That's not correct, because 2020 has 53 weeks. It causes problems with week numbering when you use a formula to count them.
Hello Marqeaux, Thank you for reporting the bug. It should be so, how you say: https://en.wikipedia.org/wiki/ISO_week_date I can confirm that the bug is present in master. Version: 7.2.0.0.alpha0+ (x64) Build ID: c0eee433e079d8e3413f4691607e075b99af92b0 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: cs-CZ (cs_CZ); UI: en-US Calc: threaded On pc Debian x86-64 with master sources updated today, I could reproduce this. Here's a code pointer: https://opengrok.libreoffice.org/xref/core/tools/source/datetime/tdate.cxx?r=445537bb#340 I see there's a wrong calculation here but don't know what was the intention. The function WEEKNUM has a second parameter to determine, which calculating system to use. For getting ISO system, you need mode 21. =WEEKNUM(DATE(2021;1;1);21) https://help.libreoffice.org/7.2/en-US/text/scalc/01/func_weeknum.html?DbPAR=CALC#bm_id3159161 Or you use directly ISOWEEKNUM. =ISOWEEKNUM(DATE(2021;1;1)) https://help.libreoffice.org/7.2/en-US/text/scalc/01/func_isoweeknum.html?DbPAR=CALC#bm_id3159161 |