diff --git a/dashboard/src/components/dashboard/StatCards.jsx b/dashboard/src/components/dashboard/StatCards.jsx index d682f7a..7cd8367 100644 --- a/dashboard/src/components/dashboard/StatCards.jsx +++ b/dashboard/src/components/dashboard/StatCards.jsx @@ -87,11 +87,9 @@ const formatPercentage = (value) => { }; const formatHour = (hour) => { - const hourNum = parseInt(hour); - if (hourNum === 0) return "12am"; - if (hourNum === 12) return "12pm"; - if (hourNum > 12) return `${hourNum - 12}pm`; - return `${hourNum}am`; + const date = new Date(); + date.setHours(hour, 0, 0); + return date.toLocaleString('en-US', { hour: 'numeric', hour12: true }); }; // Reusable chart components @@ -596,38 +594,50 @@ const OrderTypeDetails = ({ data, type }) => { }; const PeakHourDetails = ({ data }) => { + if (!data?.length) return
{time}
+Orders: {payload[0].value}
+