File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -205,11 +205,11 @@ func init() {
205
205
// The pattern supports base64 and b./ase64url. Padding ('=') is supported.
206
206
DefineStringFormat ("byte" , `(^$|^[a-zA-Z0-9+/\-_]*=*$)` )
207
207
208
- // date
209
- DefineStringFormat ("date" , `^[0-9]{4}-(0[0 -9]|10|11|12 )-([0-2 ][0-9]|30|31)$` )
208
+ // defined as full- date in https://www.rfc-editor.org/rfc/rfc3339#section-5.6
209
+ DefineStringFormat ("date" , `^[0-9]{4}-(0[1 -9]|1[0-2] )-(0[1-9]|[12 ][0-9]|30|31)$` )
210
210
211
- // date-time
212
- DefineStringFormat ("date-time" , `^[0-9]{4}-(0[0 -9]|10|11|12 )-([0-2][ 0-9]|30|31)T[ 0-9]{2}: [0-9]{2} :[0-9] {2}(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})?$` )
211
+ // defined as date-time in https://www.rfc-editor.org/rfc/rfc3339#section-5.6
212
+ DefineStringFormat ("date-time" , `^[0-9]{4}-(0[1 -9]|1[012] )-(0[1-9]|[12][ 0-9]|3[01])T(23:59:60|(([01][ 0-9]|2 [0-3])( :[0-5][0-9]) {2})) (\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})?$` )
213
213
214
214
defaultSchemaStringFormats = SaveStringFormats (SchemaStringFormats )
215
215
}
You can’t perform that action at this time.
0 commit comments