Fix the date validator, was checking indexes, not values!
All checks were successful
Publish Package / build-and-publish (push) Successful in 8s
All checks were successful
Publish Package / build-and-publish (push) Successful in 8s
This commit is contained in:
@@ -97,7 +97,7 @@ export const IsValidDateStr = (s: string): boolean => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
if (i === 4 || i === 7) continue;
|
||||
const c = s.charCodeAt(i);
|
||||
if (!isDigit(i)) return false;
|
||||
if (!isDigit(c)) return false;
|
||||
}
|
||||
|
||||
const y = parseInt(s.substring(0, 4), 10);
|
||||
|
||||
Reference in New Issue
Block a user