From 75f23db07dd9253b1700a40e944ddedadd0bab6c Mon Sep 17 00:00:00 2001 From: pranalidhanavade Date: Tue, 8 Oct 2024 20:32:21 +0530 Subject: [PATCH] fix: datetooltip fixes Signed-off-by: pranalidhanavade --- src/components/Tooltip/index.tsx | 11 +++++++++-- src/components/User/UserDashBoard.tsx | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/Tooltip/index.tsx b/src/components/Tooltip/index.tsx index 40e30c9ec..f4ba4d256 100644 --- a/src/components/Tooltip/index.tsx +++ b/src/components/Tooltip/index.tsx @@ -1,3 +1,5 @@ +import { useEffect, useState } from 'react'; + import { Tooltip } from 'flowbite-react'; import moment from 'moment'; @@ -8,9 +10,14 @@ interface DateProps { } const DateTooltip = ({date, children}: DateProps) => { + const [formattedDate,setFormattedDate]= useState("") - const updatedDate = new Date(date); - const formattedDate = date ? moment(updatedDate).format("MMM DD, YYYY, h:mm A z") : ''; + + useEffect(() => { + const updatedDate = new Date(date); + const formatdDate = date ? moment(updatedDate).format("MMM DD, YYYY, h:mm A z") : ''; + setFormattedDate(formatdDate) + }, []) return ( {
- {!credDefLoading ? ( + {!credDefLoading ? ( <> {credDefList && credDefList.length > 0 ? ( <> @@ -1066,7 +1066,7 @@ const UserDashBoard = () => {
- {/*
+

Recent Activity @@ -1106,7 +1106,7 @@ const UserDashBoard = () => {

)} -
*/} +