Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
RobJohnston wants to merge57 commits intojquery-validation:masterfromRobJohnston:master
Closed

Core: Add sanity checks to dateISO#1528

RobJohnston wants to merge57 commits intojquery-validation:masterfromRobJohnston:master

Conversation

RobJohnston
Copy link
Contributor

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])$/.

@RobJohnston
Copy link
ContributorAuthor

Relates to#939 and#1000.

src/core.js Outdated
}
}
}
return this.optional(element) || check;
Copy link
Member

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

@RobJohnston
Copy link
ContributorAuthor

@staabm : Like so? I was being consistent with dateITA originally.

@jzaefferer
Copy link
Collaborator

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

@RobJohnston
Copy link
ContributorAuthor

Just drop the slashes or also allow YYYYMMDD in addition to YYYY-MM-DD?

@jzaefferer
Copy link
Collaborator

Just disallow slashes, only allows dashes as separator.

@Arkni
Copy link
Member

Does that make sense if this validator accepts years between0000 and9999 ?
becauseMySQL 5.x accept dates between1000-01-01 and9999-12-31.

@RobJohnston
Copy link
ContributorAuthor

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.

@staabm
Copy link
Member

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

@RobJohnston
Copy link
ContributorAuthor

But was February 31st ever really valid?

@staabmstaabm added this to the2.0.0 milestoneOct 21, 2015
@staabm
Copy link
Member

at least1990/06/06,1990-6-6 and1990/6/6 were valid before..

thomasgohardand others added14 commitsMarch 6, 2016 12:06
…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`
Arkniand others added23 commitsMarch 6, 2016 12:18
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
@staabmstaabmforce-pushed themaster branch 2 times, most recently fromd621aab to3861ce2CompareSeptember 26, 2016 14:28
RobJohnston added a commit to RobJohnston/jquery-validation that referenced this pull requestJul 14, 2017
Redo of PR due to mangled repo. Stillfixesjquery-validation#1528.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
2.0.0
Development

Successfully merging this pull request may close these issues.

16 participants
@RobJohnston@jzaefferer@Arkni@staabm@thomasgohard@gitter-badger@christopherbauer@drovetto@codeclown@jcspader@dorner@od3n@netzkind@denisson@EsiKhoob@silovski

[8]ページ先頭

©2009-2025 Movatter.jp