diff --git a/lib/isDate.js b/lib/isDate.js index 1609bb86c..635536761 100644 --- a/lib/isDate.js +++ b/lib/isDate.js @@ -81,7 +81,7 @@ function isDate(str) { // check for valid double digits that could be late days // check for all matches since a string like '12/23' is a valid date // ignore everything with nearby colons - dayOrYearMatches = str.match(/(^|[^:\d])[23]\d([^:\d]|$)/g); + dayOrYearMatches = str.match(/(^|[^:\d])[23]\d([^T:\d]|$)/g); if (!dayOrYearMatches) { return true; } @@ -97,4 +97,4 @@ function isDate(str) { } return false; } -module.exports = exports['default']; \ No newline at end of file +module.exports = exports['default']; diff --git a/test/validators.js b/test/validators.js index d77b0ca7b..2f52549fa 100644 --- a/test/validators.js +++ b/test/validators.js @@ -1398,6 +1398,7 @@ describe('Validators', function () { '2015-10-20T00:53:09+12:00', '2007-04-06T00:00', '2010-02-18T16:23:48.5', + '2016-02-20T16:23:48.5', '200905', '2009-', '2009-05-19 14:',