mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-19 18:41:50 +00:00
fix: fixed bug when opening finding details while a scan is in progress (#6708)
This commit is contained in:
@@ -13,20 +13,31 @@ export const DateWithTime: React.FC<DateWithTimeProps> = ({
|
||||
inline = false,
|
||||
}) => {
|
||||
if (!dateTime) return <span>--</span>;
|
||||
const date = parseISO(dateTime);
|
||||
const formattedDate = format(date, "MMM dd, yyyy");
|
||||
const formattedTime = format(date, "p 'UTC'");
|
||||
|
||||
return (
|
||||
<div className="mw-fit py-[2px]">
|
||||
<div
|
||||
className={`flex ${inline ? "flex-row items-center gap-2" : "flex-col"}`}
|
||||
>
|
||||
<span className="text-xs font-semibold">{formattedDate}</span>
|
||||
{showTime && (
|
||||
<span className="text-tiny text-gray-500">{formattedTime}</span>
|
||||
)}
|
||||
try {
|
||||
const date = parseISO(dateTime);
|
||||
|
||||
// Validate if the date is valid
|
||||
if (isNaN(date.getTime())) {
|
||||
return <span>-</span>;
|
||||
}
|
||||
|
||||
const formattedDate = format(date, "MMM dd, yyyy");
|
||||
const formattedTime = format(date, "p 'UTC'");
|
||||
|
||||
return (
|
||||
<div className="mw-fit py-[2px]">
|
||||
<div
|
||||
className={`flex ${inline ? "flex-row items-center gap-2" : "flex-col"}`}
|
||||
>
|
||||
<span className="text-xs font-semibold">{formattedDate}</span>
|
||||
{showTime && (
|
||||
<span className="text-tiny text-gray-500">{formattedTime}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
} catch (error) {
|
||||
return <span>-</span>;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user