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 da5c57d commit c95b6a7Copy full SHA for c95b6a7
client/src/pages/tools/date-converter.tsx
@@ -183,6 +183,17 @@ export default function DateConverter() {
183
184
// Try standard date parsing
185
const date = new Date(input);
186
+ if (/^\d{4}-\d{2}-\d{2}$/.test(input)) {
187
+ const [y, m, d] = input.split("-").map(Number);
188
+
189
+ if (
190
+ date.getUTCFullYear() !== y ||
191
+ date.getUTCMonth() + 1 !== m ||
192
+ date.getUTCDate() !== d
193
+ ) {
194
+ return null;
195
+ }
196
197
return isNaN(date.getTime()) ? null : date;
198
};
199
0 commit comments