Skip to content

Commit f76630c

Browse files
authored
Merge pull request #51 from Irwin1985/jsfox
updated regEx to validate days and months
2 parents 3a265ae + 5ca3698 commit f76630c

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/jsonclass.prg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ define class JSONClass as session
44
LastErrorText = ""
55
lError = .f.
66
lShowErrors = .t.
7-
version = "9.14"
7+
version = "9.15"
88
hidden lInternal
99
hidden lTablePrompt
1010
Dimension aCustomArray[1]

src/jsonutils.prg

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ define class jsonutils as custom
3333
this.aPattern[5,2] = .t.
3434

3535
&& "DD/MM/YYYY HH:MM:SS" or "DD-MM-YYYY HH:MM:SS"
36-
this.aPattern[6,1] = "^(\d{2})([\/-])(\d{2})\2(\d{4}) (\d{2}):(\d{2}):(\d{2})$"
37-
this.aPattern[6,2] = .t.
38-
39-
&& "DD/MM/YY HH:MM:SS" or "DD-MM-YY HH:MM:SS"
40-
this.aPattern[7,1] = "^(\d{2})([\/-])(\d{2})\2(\d{2}) ([0-1]\d|2[0-3]):([0-5]\d):([0-5]\d)$"
41-
this.aPattern[7,2] = .t.
42-
36+
this.aPattern[06,1] = "^([0-2][0-9]|(3)[0-1])[\/-](((0)[0-9])|((1)[0-2]))[\/-]\d{4} (\d{2}):(\d{2}):(\d{2})$"
37+
this.aPattern[06,2] = .t.
38+
4339
&& "DD/MM/YY" or "DD-MM-YY"
44-
this.aPattern[8,1] = "^(\d{2})([\/-])(\d{2})\2(\d{2})$"
45-
this.aPattern[8,2] = .t.
40+
this.aPattern[07,1] = "^([0-2][0-9]|(3)[0-1])[\/-](((0)[0-9])|((1)[0-2]))[\/-]\d{2}$"
41+
this.aPattern[07,2] = .t.
42+
43+
&& "DD/MM/YY HH:MM:SS" or "DD-MM-YY HH:MM:SS"
44+
this.aPattern[08,1] = "^([0-2][0-9]|(3)[0-1])[\/-](((0)[0-9])|((1)[0-2]))[\/-]\d{2} (\d{2}):(\d{2}):(\d{2})$"
45+
this.aPattern[08,2] = .t.
4646

4747
_screen.oRegEx.global = .t.
4848

0 commit comments

Comments
 (0)