From 4c28efaadc01fd0782721924c3c2eff0f6f9ba7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Frane=20Poli=C4=87?=
<16856471+fPolic@users.noreply.github.com>
Date: Mon, 10 Mar 2025 12:07:52 +0100
Subject: [PATCH] fix(dashboard): display minute instead of month (#11731)
**What**
- display minutes instead of months
- remove manual offsetting since the server returns ISO format and JS date converts it to local time
---
CLOSES SUP-1069
---
.changeset/forty-bananas-tie.md | 5 +++++
.../common/date-cell/date-cell.tsx | 22 +++++++++----------
2 files changed, 15 insertions(+), 12 deletions(-)
create mode 100644 .changeset/forty-bananas-tie.md
diff --git a/.changeset/forty-bananas-tie.md b/.changeset/forty-bananas-tie.md
new file mode 100644
index 0000000000..8e2ad69cc1
--- /dev/null
+++ b/.changeset/forty-bananas-tie.md
@@ -0,0 +1,5 @@
+---
+"@medusajs/dashboard": patch
+---
+
+fix(dashboard): correctly format date cell time
diff --git a/packages/admin/dashboard/src/components/table/table-cells/common/date-cell/date-cell.tsx b/packages/admin/dashboard/src/components/table/table-cells/common/date-cell/date-cell.tsx
index e3ef58ec09..bcd40b1ff7 100644
--- a/packages/admin/dashboard/src/components/table/table-cells/common/date-cell/date-cell.tsx
+++ b/packages/admin/dashboard/src/components/table/table-cells/common/date-cell/date-cell.tsx
@@ -1,35 +1,33 @@
import { Tooltip } from "@medusajs/ui"
-import { format } from "date-fns/format"
import { useTranslation } from "react-i18next"
import { PlaceholderCell } from "../placeholder-cell"
+import { useDate } from "../../../../../hooks/use-date"
type DateCellProps = {
date?: Date | string | null
}
export const DateCell = ({ date }: DateCellProps) => {
+ const { getFullDate } = useDate()
+
if (!date) {
return