Am 06.08.2020 um 13:36 schrieb Artur Tarassow:
I've found a rather strange 'result' when using the isoweek()
function. For some reason the last 2 days of calendar year 2019 do not
refer to week 53 but week 52 instead. For 2020, however, things are
alright. Do I miss anything or is this a kind of bug?
Actually your output below shows that you get week 1 for the last two
days in 2019, not 52...
<output>
year month day week
1 2019 12 29 52
2 2019 12 30 1 # WEIRD
3 2019 12 31 1 # WEIRD
4 2020 12 29 53
5 2020 12 30 53
6 2020 12 31 53
</output>
Hm, according to the doc week 1 should refer to the one of "the first
Tuesday of the year". That would be the weeks containing 2019-1-1 and
2020-1-7.
Indeed the "WEIRD" results (which I'm also getting) do not seem to match
the doc. This also applies to isoweek(2020,1,1)
But in addition this means that your results for 2020-12-29 through
2020-12-31 are also wrong, it should be week 52 instead.
I have only checked against the gretl doc internally, not whether the
ISO norm is accurately described there (which I don't know).
cheers
sven