Bug 152986 - WEEKSINYEAR needs mentioning that it's based on ISO 8601
Summary: WEEKSINYEAR needs mentioning that it's based on ISO 8601
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-12 08:43 UTC by Mike Kaganski
Modified: 2023-01-16 10:11 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 Mike Kaganski 2023-01-12 08:43:03 UTC
WEEKSINYEAR function [1] counts weeks; and that count generally depends on a convention which year a given week belongs to. E.g., there exists a convention that the first week of a year is the week that includes Jan 1st (so the first week of the year could have 6 days in the previous year); or that the first week of a year is the week which has most of its days in this year; and also the question is, what is the first day of a week (Sunday? Monday?), which can make the difference.

WEEKSINYEAR is implemented to follow ISO 8601 conventions on this [2] (namely, the week starts on Monday; and the first week of a year is the one with most days in this year, which is equal to "the week containing Jan 4th", which is equal to "the week with the first Thursday belonging this year").

This should be reflected in the help (maybe as simple as "The function is based on ISO 8601"). Other date-related add-in functions could also need similar clarifications.

[1] https://help.libreoffice.org/7.5/en-US/text/scalc/01/04060111.html?DbPAR=CALC#bm_id3145237
[2] https://opengrok.libreoffice.org/xref/core/scaddins/source/datefunc/datefunc.cxx?r=dac843c4#616