Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update field-mapping.tsx

Tim Wilson158c6b2e7748
diff --git a/apps/web/ui/modals/import-csv-modal/field-mapping.tsx b/apps/web/ui/modals/import-csv-modal/field-mapping.tsx
index 362ef0a716..02dfc6a5f1 100644
--- a/apps/web/ui/modals/import-csv-modal/field-mapping.tsx
+++ b/apps/web/ui/modals/import-csv-modal/field-mapping.tsx
@@ -9,7 +9,13 @@ import {
TableIcon,
Xmark,
} from "@dub/ui/src/icons";
-import { cn, formatDate, getPrettyUrl, truncate } from "@dub/utils";
+import {
+ cn,
+ formatDate,
+ getPrettyUrl,
+ parseDateTime,
+ truncate,
+} from "@dub/utils";
import { readStreamableValue } from "ai/rsc";
import { ChevronDown } from "lucide-react";
import { useEffect, useMemo, useState } from "react";
@@ -98,9 +104,14 @@ function FieldRow({
break;
case "createdAt":
// Convert to date
- values = values.map((e) =>
- formatDate(new Date(e), { month: "short", year: undefined }),
- );
+ values = values.map((e) => {
+ const date = parseDateTime(e);
+ if (!date) return e;
+
+ return formatDate(date, {
+ month: "short",
+ });
+ });
break;
}