View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038290 | FPC | Other | public | 2021-01-02 09:43 | 2021-01-24 17:38 |
Reporter | Jürgen Zier | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Summary | 0038290: Error in StartOfAWeek and EndOfAWeek if YEAR = 2021 and CW = 53 | ||||
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. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
Error in Code copy, must be DateTimePicker2.Date := EndOfAWeek ( tmp_Jahr, tmp_KW ); |
|
These functions are part of FPC. Moving... |
|
There are only 52 weeks in 2021 (in 2020 there were 53). See here: https://www.epochconverter.com/weeks/2020 https://www.epochconverter.com/weeks/2021 So, the functions work as expected and they return the correct error message. |
|
Indeed, 2021 has only 52 weeks. If you think otherwise, please provide some reference, even Outlook agrees on 52 weeks :) |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-02 09:43 | Jürgen Zier | New Issue | |
2021-01-02 09:48 | Jürgen Zier | Note Added: 0128015 | |
2021-01-02 16:20 | Bart Broersma | Note Added: 0128024 | |
2021-01-02 16:20 | Bart Broersma | Project | Packages => FPC |
2021-01-22 10:55 | Zoran Vučenović | Note Added: 0128482 | |
2021-01-24 17:38 | Florian | Assigned To | => Florian |
2021-01-24 17:38 | Florian | Status | new => resolved |
2021-01-24 17:38 | Florian | Resolution | open => no change required |
2021-01-24 17:38 | Florian | FPCTarget | => - |
2021-01-24 17:38 | Florian | Note Added: 0128563 |