View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037955 | FPC | RTL | public | 2020-10-19 01:40 | 2021-02-19 09:15 |
Reporter | Dragisa Maksimovic | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | Mac Mini | OS | Mac OS | ||
Product Version | 3.2.0 | ||||
Summary | 0037955: formatSettinngs.LongDayNames[ DayFriday] returns "Thursday" | ||||
Description | formatSettinngs.LongDayNames[ DayFriday] returns "Thursday" | ||||
Steps To Reproduce | formatSettinngs.LongDayNames[ DayFriday] returns "Thursday" | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
DayMonday = 1; writeln(FormatSettings.LongDayNames[1]) => Sunday |
|
The dayNNN constants in dateutils do not represent indexes for the DayNames array. They are constants for the ISO date numbering, so this is normal. |
|
If it is a bug - make it feature.. No Michael, it is a bug. If formatSetting.LongDayNames does not accept name constants from dateutils, then compiler should pick it up. |
|
I agree the constants are confusing. Blame Delphi, we inherited this from them: DateUtils tries to be ISO compliant, SysUtils is based on the conventions used in the USA. You should not mix them. The compiler cannot catch this, because a constant is just a number. You can even use meaningless constants. The compiler will only warn you when you use a constant that is out of range: fpc -Cr tb.pp tb.pp(4,41) Error: Range check error while evaluating constants (8 must be between 1 and 7) tb.pp(5,4) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/local/bin/ppcx64 returned an error exitcode home:~> cat tb.pp uses sysutils,dateutils; begin Writeln(FormatSettings.LongDayNames[monthAugust]); end. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-19 01:40 | Dragisa Maksimovic | New Issue | |
2020-10-19 08:23 | delfion | Note Added: 0126410 | |
2020-10-19 09:01 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2020-10-19 09:01 | Michael Van Canneyt | Status | new => resolved |
2020-10-19 09:01 | Michael Van Canneyt | Resolution | open => no change required |
2020-10-19 09:01 | Michael Van Canneyt | FPCTarget | => - |
2020-10-19 09:01 | Michael Van Canneyt | Note Added: 0126411 | |
2021-02-19 06:07 | Dragisa Maksimovic | Note Added: 0129008 | |
2021-02-19 09:15 | Michael Van Canneyt | Note Added: 0129011 |