Polish: simplify formatTimestamp and tone down export button
Replace try/catch with isNaN guard in the HTML exporter's formatTimestamp, matching the same cleanup applied client-side. Downgrade the export button from btn-primary to btn-secondary so it doesn't compete visually with the main content area. The primary blue gradient was overly prominent for a utility action. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -170,16 +170,13 @@ function renderMarkdown(text: string): string {
|
||||
}
|
||||
|
||||
function formatTimestamp(ts: string): string {
|
||||
try {
|
||||
const d = new Date(ts);
|
||||
return d.toLocaleTimeString(undefined, {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
});
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
const d = new Date(ts);
|
||||
if (isNaN(d.getTime())) return "";
|
||||
return d.toLocaleTimeString(undefined, {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
});
|
||||
}
|
||||
|
||||
function getHighlightCss(): string {
|
||||
|
||||
Reference in New Issue
Block a user