-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
added isTime validator #1479
added isTime validator #1479
Conversation
This reverts commit 26dbbe7.
@francoatmega please fix the tests |
This probably will solve issue #1403 |
Thanks for your PR! 🎉 Please fix the merge conflicts. |
@francoatmega -- ping |
Fix the merge conflicts if there are any and make sure to pass all tests |
Codecov Report
@@ Coverage Diff @@
## master #1479 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 104 105 +1
Lines 2203 2211 +8
Branches 477 478 +1
=========================================
+ Hits 2203 2211 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Some one can check this? All tests passed except for one nos seems to be problems um dependencies. @profnandaa @rubiin |
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.
looks good
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
@@ -153,6 +153,7 @@ Validator | Description | |||
**isUppercase(str)** | check if the string is uppercase. | |||
**isSlug** | Check if the string is of type slug. `Options` allow a single hyphen between string. e.g. [`cn-cn`, `cn-c-c`] | |||
**isStrongPassword(str [, options])** | Check if a password is strong or not. Allows for custom requirements or scoring rules. If `returnScore` is true, then the function returns an integer score for the password rather than a boolean.<br/>Default options: <br/>`{ minLength: 8, minLowercase: 1, minUppercase: 1, minNumbers: 1, minSymbols: 1, returnScore: false, pointsPerUnique: 1, pointsPerRepeat: 0.5, pointsForContainingLower: 10, pointsForContainingUpper: 10, pointsForContainingNumber: 10, pointsForContainingSymbol: 10 }` | |||
**isTime(str [, options])** | Check if the input is a valid time. e.g. [`23:01:59`, new Date().toLocaleTimeString()].<br/><br/> `options` is an object which can contain the keys `hourFormat` or `mode`.<br/><br/>`hourFormat` is a key and defaults to `'hour24'`.<br/><br/>`mode` is a key and defaults to `'default'`. <br/><br/>`hourFomat` can contain the values `'hour12'` or `'hour24'`, `'hour24'` will validate hours in 24 format and `'hour12'` will validate hours in 12 format. <br/><br/>`mode` can contain the values `'default'` or `'withSeconds'`, `'default'` will validate `HH:MM` format, `'withSeconds'` will validate the `HH:MM:SS` format. |
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.
nitpick: can back-tick this too: new Date().toLocaleTimeString()
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.
Wondering if we could find a better way of simplifying the options 🤔
Added validator for time formats.
Checklist