Skip to content

Commit

Permalink
#14 4-digits inference to date-time fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
subwiz committed Nov 23, 2018
1 parent 9d1ba8a commit 66d5c99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/wiztools/xsdgen/TypeInferenceUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ private TypeInferenceUtil() {}
public static final String XSD_TIME = ":time";

// Pattern from: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime
private static final Pattern P_DATE_TIME = Pattern.compile("^[+-]?\\d{4}(-[01]\\d(-[0-3]\\d(T[0-2]\\d:[0-5]\\d:?([0-5]\\d(\\.\\d+)?)?([+-][0-2]\\d:[0-5]\\d)?Z?)?)?)?$");
// Customized for #14: https://github.com/wiztools/xsd-gen/issues/14
private static final Pattern P_DATE_TIME = Pattern.compile("^[+-]?\\d{4}-[01]\\d-[0-3]\\d(T[0-2]\\d:[0-5]\\d:?([0-5]\\d(\\.\\d+)?)?([+-][0-2]\\d:[0-5]\\d)?Z?)?$");
public static final String XSD_DATE_TIME = ":dateTime";

private static final Pattern P_INT = Pattern.compile("-?\\d{1,9}");
Expand Down

0 comments on commit 66d5c99

Please sign in to comment.