-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Core: Add sanity checks to dateISO #1528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/core.js
Outdated
} | ||
} | ||
} | ||
return this.optional(element) || check; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the optional check in a short-circuit to be consistent with other rules which do the heavy checks only when necessary
@staabm : Like so? I was being consistent with dateITA originally. |
Thanks for the contribution! While we're at it, let's drop the slashes and update the tests accordingly. I have no idea why they're there. W3C doesn't list anything with slashes either: http://www.w3.org/TR/NOTE-datetime |
Just drop the slashes or also allow YYYYMMDD in addition to YYYY-MM-DD? |
Just disallow slashes, only allows dashes as separator. |
Does that make sense if this validator accepts years between |
True for MySQL, but different databases have different ranges (and sometimes dates are not stored in databases): A quick search:
I would think that the min method and max method would be the places to specify acceptable ranges. EDIT: Maybe not. This came up in #455 and could not be easily fixed. |
Not sure we can handle as invalid which were valid before and vice versa. I would merge such a change only with a new major version |
But was February 31st ever really valid? |
at least |
…data obj when validating, incorrectly returning previous status This change determines if either the validated element's value OR one of the data properties has changed before aborting the remote request. If your remote validation is skipped due to being dependent on the value of another field, this fixes that issue.
Incorrect tests were rebased.
.. not for building `aria-describedby`
This reverts commit b2df81c.
I found no appearant reason why a BIC has to be all-upper, so allowing customers to enter it lowercase or mixed should be ok. Furthermore, the IBAN-validation also is case-insensitive. Closes #1547
For historical reasons, the value IDL attribute prefixes the file name with the string "C:\fakepath\". As a result of this, this fix will extract the file name from the value IDL attribute in a backwards-compatible way. For more details, see: - http://www.w3.org/TR/html5/forms.html#dom-input-value-filename - http://www.w3.org/TR/html5/forms.html#fakepath-srsly Fixes #1615
`^0.4.0` Is equivalent to `0.4.*` but actually for a sementic versioned lib what we want is `>=0.4` aka `^0.4`
Closes #1673. Hello, and thank you for this good plugin I find a bug in Farsi (Persian) localization exist in messages_fa.js The "min"&"max" methods messages in that file have bug. The Farsi "min" `s message has this meaning: “please enter value greater that {0} words.” Phrase meaning "word" should be removed from Farsi message.
…tion Conflicts: src/additional/accept.js src/additional/additional.js src/additional/bankaccountNL.js src/additional/bic.js src/additional/cpfBR.js src/additional/creditcardtypes.js src/additional/dateITA.js src/additional/iban.js src/additional/phonesUK.js src/additional/url2.js src/core.js src/localization/messages_pt_BR.js test/error-placement.js test/index.html test/methods.js
d621aab
to
3861ce2
Compare
Redo of PR due to mangled repo. Still fixes jquery-validation#1528.
Added checks for leap years and for months that only have 30 days.
I've re-used the regex for dateISO, but I was talking to @nschonni and from what we can see, the slashes are not part of the ISO 8601 standard (but the canonical source is paywalled). It's either a dash or nothing, so maybe the regex should be
/^(\d{4})(?:\-)*(0?[1-9]|1[012])(?:\-)*(0?[1-9]|[12][0-9]|3[01])$/
.