You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So why we have isDateString and also isISO8601 validators? :) Looks like isDateString should be just alias for isISO8601. @rubiin thnx for the point us to this.
@vlapo I must have missed the isISO8601 validator. Agree that isDateString should be an alias for isISO8601. Unless there is some important distinction that mean we'd want both.
Okey after small research I think we have some duplicity and missing functionality/lack of docs.
isDateString validator should be "alias" for isISO8601 not some kind of magic regexp in our codebase - looks like merging validate date iso string #88 was not a good idea. But I think we should keep this alias as it is more suggestive validator name than isISO8601
"2019-18-13T22:14:14.761Z", because we can use any month in the range from 0 to 19
"2019-12-39T22:14:14.761Z", because we can use any day in the range from 0 to 39
"2019-12-31T29:14:14.761Z", because we can use any hour in the range from 0 to 29
I think we can fix the isDateString validator and the isISO8601 validator for a start.
And we will make some update for support "only date string" inputs as "2019-04-04" after solving validatorjs/validator.js#1130
We have the IsISO8601 decorator, now. I think using isDateString and isISO8601 alias for the same functionality is not a good idea. What about you? @vlapo@rubiin
@ihorTymofieiev none of these date validators seem to currently work with actual ISO8601 strings. Is there any PR that can be merged to resolve this? Or can I assist somehow? Dates are pretty much broken right now,
Activity
[-]isDateString does not follow ISO-8601 [/-][+]isDateString does not follow ISO-8601 ?[/+]vlapo commentedon Sep 24, 2019
Hi @jacktuck,
We are open to PR with fix and of course do not forget tests.
rubiin commentedon Sep 25, 2019
@vlapo however validatorjs seems to have another regex https://github.com/validatorjs/validator.js/blob/master/src/lib/isISO8601.js
vlapo commentedon Sep 25, 2019
So why we have
isDateStringand alsoisISO8601validators? :) Looks likeisDateStringshould be just alias forisISO8601. @rubiin thnx for the point us to this.@jacktuck what do you think?
jacktuck commentedon Sep 25, 2019
@vlapo I must have missed the isISO8601 validator. Agree that isDateString should be an alias for isISO8601. Unless there is some important distinction that mean we'd want both.
rubiin commentedon Sep 25, 2019
Assumming the regex applied, both of them seem to be different. However we can still use the validatorjs's regex on isdatestring @vlapo
joseym commentedon Oct 8, 2019
Currently unable to get dates to validate with either
isDateStringandIsISO8601vlapo commentedon Oct 14, 2019
Okey after small research I think we have some duplicity and missing functionality/lack of docs.
isDateStringvalidator should be "alias" forisISO8601not some kind of magic regexp in our codebase - looks like merging validate date iso string #88 was not a good idea. But I think we should keep this alias as it is more suggestive validator name thanisISO8601isISO8601accepts also "only date string" inputs as2019-04-04- how can i use isDate() #407strictoption parameter inisISO8601isRFC3339validator asRFC3339is also date format standard - validatorjsihorTymofieiev commentedon Nov 14, 2019
Merging #88 was a really not a good idea(
Issues for
isDateString:I think we can fix the
isDateStringvalidator and theisISO8601validator for a start.And we will make some update for support "only date string" inputs as "2019-04-04" after solving validatorjs/validator.js#1130
We have the IsISO8601 decorator, now. I think using
isDateStringandisISO8601alias for the same functionality is not a good idea. What about you? @vlapo @rubiincjancsar commentedon Dec 19, 2019
@ihorTymofieiev none of these date validators seem to currently work with actual ISO8601 strings. Is there any PR that can be merged to resolve this? Or can I assist somehow? Dates are pretty much broken right now,
ihorTymofieiev commentedon Jan 3, 2020
@cjancsar, recent changes with fix this validator are not yet available as the npm package.
@vlapo
fix: IsDateString() decorator now an alias for isISO8601()
fix: alias IsDateString decorator to IsISO8601
github-actions commentedon Sep 4, 2020
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.