Hi all,
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?
Best,
Artur
<hansl>
clear
nulldata 800
setobs 7 2019-01-01 --time-series
series year, month, day
isoconv($obsdate, &year, &month, &day)
series week = isoweek(year, month, day) # new week starts
Monday
smpl month == 12 && day > 28 --restrict
print year month day week -o
</hansl>
returns
<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>