Error in StartOfAWeek and EndOfAWeek if YEAR = 2021 and CW = 53
Original Reporter info from Mantis: Kutscher
-
Reporter name: Jürgen Zier
Original Reporter info from Mantis: Kutscher
- Reporter name: Jürgen Zier
Description:
I will set a datefield to the first date of the week and the next datefield to the last day of the week.
If year = 2021 and calendar week = 53 then I get this error:
StartOfAWeek ( tmp_Jahr, tmp_KW ); -> 2021 53 1 is not a valid dateweek
EndOfAWeek ( tmp_Jahr, tmp_KW ); -> 2021 53 7 is not a valid dateweek
Steps to reproduce:
My code:
...
var
tmp_Jahr: word;
tmp_KW: word;
begin
tmp_Jahr := 2021;
tmp_KW := 53;
DateTimePicker1.Date := StartOfAWeek ( tmp_Jahr, tmp_KW );
DateTimePicker2 := EndOfAWeek ( tmp_Jahr, tmp_KW );
end;
Additional information:
If I set tmp_Jahr to 2020 and tmp_KW to 53 it works fine.
Mantis conversion info:
- Mantis ID: 38290
- Build: r62944
- Version: 2.0.8