Skip to content

Commit

Permalink
fix: datetooltip fixes
Browse files Browse the repository at this point in the history
Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Oct 8, 2024
1 parent 2305b10 commit 75f23db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/components/Tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useEffect, useState } from 'react';

import { Tooltip } from 'flowbite-react';
import moment from 'moment';

Expand All @@ -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 (
<Tooltip
Expand Down
6 changes: 3 additions & 3 deletions src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ const UserDashBoard = () => {
</div>
<hr />

{!credDefLoading ? (
{!credDefLoading ? (
<>
{credDefList && credDefList.length > 0 ? (
<>
Expand Down Expand Up @@ -1066,7 +1066,7 @@ const UserDashBoard = () => {
</div>
</div>
<div className="">
{/* <div className="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm dark:border-gray-700 sm:p-6 dark:bg-gray-800 xl:mb-0">
<div className="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm dark:border-gray-700 sm:p-6 dark:bg-gray-800 xl:mb-0">
<div className="items-start justify-start mb-4">
<h3 className="text-xl font-semibold text-gray-900 dark:text-white mb-3">
Recent Activity
Expand Down Expand Up @@ -1106,7 +1106,7 @@ const UserDashBoard = () => {
<CustomSpinner />
</div>
)}
</div> */}
</div>
</div>
</div>

Expand Down

0 comments on commit 75f23db

Please sign in to comment.