An ENTRY(@d1) is format MM/DD/YY with a 2 digit year. Entering dates in Clarion is very flexible and converts to the Entry Picture e.g. you can omit the slashes.
I found a bug that if a 4 digit Year is entered into a ENTRY(@d1)
the RTL will Flip the Month and Day (when Day is <= 12).
So as shown entering July 4th as 07042024 or 7/4/2024 it will convert to 2 digit Year then flip MM/DD and set the date to 04/07/24 i.e. April 7th. This is confirmed by the STRING(@d4)
out to the right.
This does not happen for Entry(@d5) = DD/MM/YY . I made the above Animated GIF screen capture using the GifCap website.
Test Code. I’ve checked C10, 11.0 and 11.1.
PROGRAM
MAP
D1BugTest PROCEDURE()
END
CODE
D1BugTest()
!----------------------------
D1BugTest PROCEDURE
d1 LONG
d2 LONG
d5 LONG
d6 LONG
Window WINDOW('Entry @d1 Bug YYYY'),AT(,,282,121),GRAY,IMM,AUTO,SYSTEM,FONT('Segoe UI',9),RESIZE
STRING('Enter @d1 Date as 07042024 or 7/4/2024 (4 digit year) i.e. July 4th'),AT(7,2), |
USE(?BugFyi_1)
STRING('Press Tab and see @d1 flips Month & Day so = 4/7/24 i.e. April 7th'),AT(7,12), |
USE(?BugFyi_2)
PROMPT('Entry @d1 M-D-YY'),AT(7,27),USE(?Prompt:D1)
ENTRY(@d01b),AT(87,27,67,11),USE(d1)
STRING(@d04b),AT(168,27),USE(d1,, ?d1:d4)
PROMPT('Entry @d2 M-D-YYYY'),AT(7,42),USE(?Prompt:D2)
ENTRY(@d02b),AT(87,42,67,11),USE(d2)
STRING(@d04b),AT(168,42),USE(d2,, ?d2:d4)
PROMPT('Entry @d5 DD-M-YY'),AT(7,65),USE(?Prompt:D5)
ENTRY(@d05b),AT(87,65,67,11),USE(d5)
STRING(@d04b),AT(168,65),USE(d5,, ?d5:d4)
PROMPT('Entry @d6 DD-M-YYYY'),AT(7,80),USE(?Prompt:D6)
ENTRY(@d06b),AT(87,80,67,11),USE(d6)
STRING(@d04b),AT(168,80),USE(d6,, ?d6:d4)
END
CODE
OPEN(WINDOW)
0{PROP:text}=clip(0{PROP:text}) &' - Library ' & system{PROP:LibVersion,2} &'.'& system{PROP:LibVersion,3}
ACCEPT
END
d1_EntryBugYYYY_Proj.zip (1.3 KB)