(timestamp, compact = false)
| 464 | |
| 465 | // Utilities |
| 466 | formatTimestamp(timestamp, compact = false) { |
| 467 | if (!timestamp || timestamp === "unknown") { |
| 468 | return "Unknown"; |
| 469 | } |
| 470 | |
| 471 | const date = new Date(timestamp); |
| 472 | if (isNaN(date.getTime())) { |
| 473 | return "Invalid Date"; |
| 474 | } |
| 475 | |
| 476 | if (compact) { |
| 477 | const hour12 = getUserHour12(); |
| 478 | // For table display: MM/DD HH:mm |
| 479 | return new Intl.DateTimeFormat("en-US", { |
| 480 | month: "2-digit", |
| 481 | day: "2-digit", |
| 482 | hour12, |
| 483 | hour: hour12 ? "numeric" : "2-digit", |
| 484 | minute: "2-digit", |
| 485 | timeZone: getUserTimezone(), |
| 486 | }).format(date); |
| 487 | } else { |
| 488 | const hour12 = getUserHour12(); |
| 489 | // For details: Full format |
| 490 | return new Intl.DateTimeFormat("en-US", { |
| 491 | year: "numeric", |
| 492 | month: "long", |
| 493 | day: "numeric", |
| 494 | hour12, |
| 495 | hour: hour12 ? "numeric" : "2-digit", |
| 496 | minute: "2-digit", |
| 497 | timeZone: getUserTimezone(), |
| 498 | }).format(date); |
| 499 | } |
| 500 | }, |
| 501 | |
| 502 | formatTags(tags) { |
| 503 | if (!Array.isArray(tags) || tags.length === 0) return "None"; |
nothing calls this directly
no test coverage detected