aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/components/highlights
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2026-02-01 19:26:23 +0000
committerMohamed Bassem <me@mbassem.com>2026-02-01 19:26:23 +0000
commitb16fa5e21a3852151c6b3d3d5569154d863d1795 (patch)
tree4550462032a98c44a2c0581982e6676dee3d099b /apps/mobile/components/highlights
parent45db6147032071d270fbf2b577a234393247d921 (diff)
downloadkarakeep-b16fa5e21a3852151c6b3d3d5569154d863d1795.tar.zst
chore: replace dayjs with data-fns
Diffstat (limited to 'apps/mobile/components/highlights')
-rw-r--r--apps/mobile/components/highlights/HighlightCard.tsx7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/mobile/components/highlights/HighlightCard.tsx b/apps/mobile/components/highlights/HighlightCard.tsx
index fd5ff752..31b3c829 100644
--- a/apps/mobile/components/highlights/HighlightCard.tsx
+++ b/apps/mobile/components/highlights/HighlightCard.tsx
@@ -3,8 +3,7 @@ import * as Haptics from "expo-haptics";
import { useRouter } from "expo-router";
import { Text } from "@/components/ui/Text";
import { useQuery } from "@tanstack/react-query";
-import dayjs from "dayjs";
-import relativeTime from "dayjs/plugin/relativeTime";
+import { formatDistanceToNow } from "date-fns";
import { ExternalLink, Trash2 } from "lucide-react-native";
import type { ZHighlight } from "@karakeep/shared/types/highlights";
@@ -13,8 +12,6 @@ import { useTRPC } from "@karakeep/shared-react/trpc";
import { useToast } from "../ui/Toast";
-dayjs.extend(relativeTime);
-
// Color map for highlights (mapped to Tailwind CSS classes used in NativeWind)
const HIGHLIGHT_COLOR_MAP = {
red: "#fecaca", // bg-red-200
@@ -108,7 +105,7 @@ export default function HighlightCard({
<View className="flex flex-row items-center justify-between">
<View className="flex flex-row items-center gap-2">
<Text className="text-xs text-muted-foreground">
- {dayjs(highlight.createdAt).fromNow()}
+ {formatDistanceToNow(highlight.createdAt, { addSuffix: true })}
</Text>
{bookmark && (
<>