We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b145c37 commit 6eafa09Copy full SHA for 6eafa09
1 file changed
src/lib/isDate.js
@@ -63,11 +63,10 @@ function extractDatePartsWithoutDelimiter(input, format) {
63
const dateObj = {};
64
65
for (const comp of components) {
66
- const value = input.substring(comp.start, comp.start + comp.length);
67
- if (value.length !== comp.length) {
68
- return null; // Input too short
69
- }
70
- dateObj[comp.type] = value;
+ dateObj[comp.type] = input.substring(
+ comp.start,
+ comp.start + comp.length
+ );
71
}
72
73
return dateObj;
@@ -105,9 +104,6 @@ export default function isDate(input, options) {
105
104
return false;
106
107
dateObj = extractDatePartsWithoutDelimiter(input, options.format);
108
- if (!dateObj) {
109
- return false;
110
111
} else {
112
// Original delimiter-based parsing
113
const formatDelimiter = options.delimiters
0 commit comments