Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 themin method andmax 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 statusThis 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 commitb2df81c.
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 namewith the string "C:\fakepath\". As a result of this,this fix will extract the file name from the value IDL attribute in abackwards-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-srslyFixes#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 pluginI find a bug in Farsi (Persian) localization exist in messages_fa.jsThe "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.
…tionConflicts:src/additional/accept.jssrc/additional/additional.jssrc/additional/bankaccountNL.jssrc/additional/bic.jssrc/additional/cpfBR.jssrc/additional/creditcardtypes.jssrc/additional/dateITA.jssrc/additional/iban.jssrc/additional/phonesUK.jssrc/additional/url2.jssrc/core.jssrc/localization/messages_pt_BR.jstest/error-placement.jstest/index.htmltest/methods.js
d621aab
to3861ce2
CompareRedo of PR due to mangled repo. Stillfixesjquery-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 theISO 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])$/
.