mirror of https://github.com/apache/nifi.git
NIFI-13557 Corrected Date Time Matcher to support single digit months
This closes #9094 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
36b9edd862
commit
059a3b7745
|
@ -384,7 +384,7 @@ public class RegexDateTimeMatcher implements DateTimeMatcher {
|
|||
}
|
||||
|
||||
private void addShortMonth() {
|
||||
patterns.add("(?:0[1-9]|1[0-2])");
|
||||
patterns.add("(?:0?[1-9]|1[0-2])");
|
||||
range = range.plus(1, 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ public class TestRegexDateTimeMatcher {
|
|||
exampleToPattern.put("2018/12/12", "yyyy/MM/dd");
|
||||
exampleToPattern.put("12/12/2018", "MM/dd/yyyy");
|
||||
exampleToPattern.put("12/12/18", "MM/dd/yy");
|
||||
exampleToPattern.put("1/1/18", "M/d/yy");
|
||||
exampleToPattern.put("1/10/18", "M/d/yy");
|
||||
exampleToPattern.put("1:40:55", "HH:mm:ss");
|
||||
exampleToPattern.put("01:0:5", "HH:mm:ss");
|
||||
exampleToPattern.put("12/12/2018 13:04:08 GMT-05:00", "MM/dd/yyyy HH:mm:ss z");
|
||||
|
|
Loading…
Reference in New Issue