Bug 146854 - The Funktion WEEKNUM counts wrong
Summary: The Funktion WEEKNUM counts wrong
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-19 10:48 UTC by Björn
Modified: 2022-01-21 13:18 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn 2022-01-19 10:48:17 UTC
Description:
The first Week in a year is the week with the First thursday in the year.
The Funktion say the 01.01.2022 is in the first week of 2022. That is wrong. 

Steps to Reproduce:
1.fill the Date 01.01.2022 to Cell A1.
2.fill "=KALENDERWOCHE(A1;1)" to an other cell
3.

Actual Results:
it shows "1"

Expected Results:
53


Reproducible: Always


User Profile Reset: No



Additional Info:
The first week in 2022 starts on sunday 03.01.22 or on monday 04.01.22
Comment 1 Björn 2022-01-19 10:53:19 UTC
Expected Results is not 53, its 52. Sorry
Comment 2 Jari 2022-01-19 13:56:38 UTC
Hi,

Thank you for a bug report, 

Same bug happened to me too,

same problem happened with:

Version: 7.2.5.2 (x64) / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 12; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: CL

And:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 52443996eff721e612ac4afc1eb1a53bb8a3e06f
CPU threads: 12; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: fi-FI
Calc: CL
Comment 3 Jari 2022-01-19 14:28:07 UTC
Changed Bug Status Unconfirmed - > NEW
Comment 4 Julien Nabet 2022-01-20 20:10:10 UTC
Just for the record, on pc Debian x86-64 with LO Debian package 7.2.5.2, I don't reproduce this.
Comment 5 Björn 2022-01-21 09:18:24 UTC
I updated to 7.2.5.2 / LibreOffice Community.
On CPU-Threads: 8 BS: Linux 5.13
Ubuntu package version: 1:7.2.5_rc20ubuntu0.20.04.1~lo1

And the error remains.
Comment 6 Buovjaga 2022-01-21 12:59:23 UTC Comment hidden (obsolete)
Comment 7 Mike Kaganski 2022-01-21 13:10:13 UTC
(In reply to Björn from comment #0)
> Description:
> The first Week in a year is the week with the First thursday in the year.
> The Funktion say the 01.01.2022 is in the first week of 2022. That is wrong. 

The function WEEKNUM [1] is defined differently:

> System 1 The week containing January 1 is the first week of the year, and is
>          numbered week 1.

If you need ISO numbering, use System 2, or use ISOWEEKNUM [2].

[1] https://help.libreoffice.org/latest/en-US/text/scalc/01/func_weeknum.html?DbPAR=CALC
[2] https://help.libreoffice.org/latest/en-US/text/scalc/01/func_isoweeknum.html?DbPAR=CALC
Comment 8 Buovjaga 2022-01-21 13:18:08 UTC
(In reply to Buovjaga from comment #6)
> No repro here, I get 52 for =WEEKNUM(A1;1) in this case.
> 
> Arch Linux 64-bit
> Version: 7.2.5.2.0+ / LibreOffice Community
> Build ID: 20(Build:2)
> CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: fi-FI (fi_FI.UTF-8); UI: en-US
> 7.2.5-4
> Calc: threaded

Sorry I made a mistake in my test. I got 1.