Description: When using a formula for counting the week numbers, LibreOffice counts it wrong. The reason is because 2020 has 53 weeks instead of 52. LibreOffice Calc doesn't recognize week 53, so it starts counting at week 1, starting this coming year 2021. The result of it is that LibreOffice will be one week behind in counting weeks. The attachement shows what I mean... Steps to Reproduce: 1. Open a Calc document 2. Use the formula for counting week numbers (don't know the name of that formula in English 3. See that the weeknumber will be one week behind, starting in 2021 Actual Results: Week 1 - 2021 instead of week 53 - 2020, and so on starting from the last week of 2020.... Expected Results: Reproducible: Always User Profile Reset: Yes Additional Info: Recognize week 53 to make the week numbering correct again.
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