[Libreoffice-bugs] [Bug 139421] Calc: calcuate weeknumber-year missing in 2021
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Fri Jan 8 18:41:02 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=139421
--- Comment #10 from Eike Rathke <erack at redhat.com> ---
Coming up with an arbitrary made-up format code like YW or WWW is fragile as
you never know if Excel doesn't come along with a different definition of the
same later.. Abusing a [NatNum#] modifier for this also isn't appealing.
However, we could introduce a new modifier [WeekNum=#] where # can take either
* the same values as the WEEKNUM() Mode parameter
* benefit: the same values user might know
* drawback: just those values
or
* values that define the minimum number of days in a week and the start
day of the week, by which all week definitions can be described, which
is what locale data uses
* here the WEEKNUM() Mode values 11..17 could mean the same,
MinimalDaysInFirstWeek=1 and StartDayOfWeek=1..7
* the WEEKNUM() Mode=1 US definition would be 17,
MinimalDaysInFirstWeek=1 and StartDayOfWeek=7 (Sunday)
(where generally MinimalDaysInFirstWeek=1 means the week containing
January 1 is week 1)
* the WEEKNUM() Mode=2 definition would be 11,
MinimalDaysInFirstWeek=1 and StartDayOfWeek=1 (Monday)
* the ISO definition would be 41, MinimalDaysInFirstWeek=4 and
StartDayOfWeek=1 (Monday)
* benefit: all possible week definitions
* drawback: user might have a harder time figuring out, may need an
extra help page
I tend to the latter because of its flexibility and so we're not stuck with the
definition of WEEKNUM(). Though in practice (locale data) I haven't seen
definitions using other than StartDayOfWeek={mon,sat,sun} and
MinimalDaysInFirstWeek={1,4,7}; these already are not all representable with
the WEEKNUM() Mode definition.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210108/6242f576/attachment.htm>
More information about the Libreoffice-bugs
mailing list