Bug 70551 - WEEKS() function uses ISO weeknum and is not locale-dependent, which is not explained in the Help
Summary: WEEKS() function uses ISO weeknum and is not locale-dependent, which is not e...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
: 106516 (view as bug list)
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
Reported: 2013-10-16 22:15 UTC by John Smith
Modified: 2021-11-08 07:32 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

Spreadsheet illustrating the problem described. (61.61 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-10-16 22:15 UTC, John Smith

Note You need to log in before you can comment on or make changes to this bug.
Description John Smith 2013-10-16 22:15:27 UTC
Created attachment 87761 [details]
Spreadsheet illustrating the problem described.

Problem description: An incorrect result is returned for some dates entered into this function

Steps to reproduce:
1. Open Calc
2. Enter data, such as 1st April 2011, 1st May 2011 and number 1, into cells A1, A2 and A3 respectively
3. in cell 4 enter the function, using the Function Wizard, of WEEKS(A1,A2,A3)

Current behavior:
It returns the result 4
Expected behavior:
It should return the result 5. The two dates appear in weeks which are 5 weeks apart.

Computer is set to US-locale.
Operating System: Windows XP
Version: release
Comment 1 Tomaz Vajngerl 2013-10-17 07:07:31 UTC
I guess this is a problem with first day of the week. In this case if the first day is Monday then there are 4 weeks, if it is Sunday then 5. As the locale you have is US-locale then the first day should be Sunday so I guess this is a locale related bug.
Comment 2 John Smith 2013-10-17 09:41:30 UTC
Changing the computer to UK locale also gives same result.
Comment 3 GerardF 2013-10-17 13:07:54 UTC
Yes. It seems that WEEKS use the ISO weeknum (Monday as 1st day of the week).

As the WEEKS function is not defined in OASIS specification, i don't know what is the expected result... and i don't think the result should be locale dependant.
Comment 4 John Smith 2013-10-17 16:53:53 UTC
It's difficult to assign a cause without knowing the internal workings of the function. Another explanation could be that it calculates up to, but does not include, the End date, that would fit the results. As I say, without knowing the internals ...
Comment 5 Cor Nouws 2013-10-31 20:50:27 UTC

I change the summary ... OK like this?
Also I assume that this is already the case since the ages of OOo..
Comment 6 John Smith 2013-11-03 15:35:29 UTC
(In reply to comment #5)
> Hi,
> I change the summary ... OK like this?
> Also I assume that this is already the case since the ages of OOo..

Does this mean you have actually determined the cause to be the ISO weeknum, rather than suspecting that it is the cause? As I point out, not including the final date also would explain it.
Comment 7 QA Administrators 2015-04-19 03:22:49 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2016-09-20 09:24:20 UTC Comment hidden (obsolete)
Comment 9 Cor Nouws 2017-03-12 21:17:04 UTC
*** Bug 106516 has been marked as a duplicate of this bug. ***
Comment 10 QA Administrators 2018-07-24 02:37:48 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2020-07-24 03:46:19 UTC
Dear John Smith,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team