fix(SEC-WEB-26+29): Remove console.log + fix formatTime error handling
- Remove debug console.log from workspaces page and teams page - Fix formatTime to return "Invalid date" fallback instead of empty string when date parsing fails (handles both thrown errors and NaN dates) - Export formatTime and add unit tests for error handling cases Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
dfef71b660
commit
65b078c85e
@@ -313,12 +313,15 @@ function LoadingIndicator({ quip }: { quip?: string | null }): React.JSX.Element
|
||||
);
|
||||
}
|
||||
|
||||
function formatTime(isoString: string): string {
|
||||
export function formatTime(isoString: string): string {
|
||||
try {
|
||||
const date = new Date(isoString);
|
||||
if (isNaN(date.getTime())) {
|
||||
return "Invalid date";
|
||||
}
|
||||
return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
||||
} catch {
|
||||
return "";
|
||||
return "Invalid date";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user