File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change 1
1
const rdapValidator = { } ;
2
2
3
+ const iso8601DateTimeRegexp = / ^ \d { 4 , } - \d { 2 } - \d { 2 } [ T t ] \d { 2 } : \d { 2 } : \d { 2 } / gi;
4
+
3
5
const self = rdapValidator ;
4
6
5
7
export default rdapValidator ;
@@ -957,22 +959,30 @@ self.validateEvent = function (event) {
957
959
) ;
958
960
959
961
} else if ( "eventDate" == k ) {
962
+ self . pushSpec ( "rfc3339" ) ;
960
963
var pass ;
961
964
962
- try {
963
- new Date ( event . eventDate ) ;
964
- pass = true ;
965
-
966
- } catch ( e ) {
965
+ if ( ! iso8601DateTimeRegexp . test ( ) ) {
967
966
pass = false ;
968
967
968
+ } else {
969
+ try {
970
+ new Date ( event . eventDate ) ;
971
+ pass = true ;
972
+
973
+ } catch ( e ) {
974
+ pass = false ;
975
+
976
+ }
969
977
}
970
978
971
979
self . add (
972
980
pass ,
973
981
"The 'eventDate' property MUST be a valid date/time." ,
974
- "section-4.5 " ,
982
+ "section-5.6 " ,
975
983
) ;
984
+
985
+ self . popSpec ( "rfc3339" ) ;
976
986
}
977
987
}
978
988
@@ -2680,6 +2690,7 @@ self.referenceBase = "https://validator.rdap.org/specs/";
2680
2690
* Path segments for specifications.
2681
2691
*/
2682
2692
self . referenceURLs = {
2693
+ "rfc3339" : "vanilla/rfc3339.html" ,
2683
2694
"rfc6350" : "vanilla/rfc6350.html" ,
2684
2695
"rfc7095" : "vanilla/rfc7095.html" ,
2685
2696
"rfc7480" : "vanilla/rfc7480.html" ,
You can’t perform that action at this time.
0 commit comments