-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Describe the bug
I was trying to validate RFC 3339 full-time type by appending it to an RFC 3339 full-date followed by T, to make an RFC 3339 date-time. In my tests I had previously been using full ISO strings for this field, and was surprised when the tests still passed.
Examples
const v = require('validator')
const badString = '2021-01-01T' + new Date().toISOString()
// '2021-01-01T2021-04-21T12:00:12.644Z'
// This string is obviously not a valid RFC 3339 full-date, since it contains two instances of "T"
v.isRFC3339(badString)
// trueAdditional context
Validator.js version: 13.5.2
Node.js version: 14.16.0
OS platform: macOS
Shread1234