refactor(isDate): add strictMode and prevent mixed delimiters#1402
refactor(isDate): add strictMode and prevent mixed delimiters#1402profnandaa merged 2 commits intovalidatorjs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1402 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 95 95
Lines 1248 1257 +9
=========================================
+ Hits 1248 1257 +9
Continue to review full report at Codecov.
|
|
validator.isDate('2020-05-02', { format: 'YYYY/MM/DD', strictMode: true}); /// returns false
validator.isDate(new Date(), { format: 'YYYY/MM/DD', strictMode: true}); // returns false |
|
@tux-tn thanks for working on this. |
profnandaa
left a comment
There was a problem hiding this comment.
LGTM, thanks for the good work on this. I'm okay at some point down the line, making strictMode = true the default -- but for now, this is okay to maintain b/c.
Hello,
I made some changes to
isDateto allow for more flexibility.strictModeto enforce strict comparison between input and format. InstrictModeDate objects, inputs with a different delimiter or string format are disallowed.delimiterslistisDate(input, format)Checklist