(epoch: any)
| 34 | } |
| 35 | |
| 36 | export function fmtTime(epoch: any): string { |
| 37 | const v = Number(epoch); |
| 38 | if (!v) return ""; |
| 39 | try { |
| 40 | const d = new Date(v * 1000); |
| 41 | if (isoTimeAgo) return isoTimeAgo(d.toISOString()); |
| 42 | return d.toLocaleString(); |
| 43 | } catch (e) { |
| 44 | return String(epoch); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | export function fmtAbsoluteTime(epoch: any): string { |
| 49 | const v = Number(epoch); |
no test coverage detected