date parsing bug fix

This commit is contained in:
2025-07-22 10:58:43 +05:30
parent 58d2a1c96c
commit 496b73ceda

View File

@@ -3,7 +3,7 @@ import mongoose from "mongoose";
type MongoFilter = Record<string, any>;
function convertValue(value: string) {
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
if (!isNaN(new Date(value).getTime())) {
return new Date(value);
} else if (!isNaN(Number(value))) {
return Number(value);