(date: Date = new Date())
| 50 | |
| 51 | // Mar 27 09:17:25.653 |
| 52 | export function prettyPrintDate(date: Date = new Date()) { |
| 53 | let formattedDate = new Intl.DateTimeFormat("en-US", { |
| 54 | month: "short", |
| 55 | day: "2-digit", |
| 56 | hour: "2-digit", |
| 57 | minute: "2-digit", |
| 58 | second: "2-digit", |
| 59 | hour12: false, |
| 60 | }).format(date); |
| 61 | |
| 62 | // Append milliseconds |
| 63 | formattedDate += "." + ("00" + date.getMilliseconds()).slice(-3); |
| 64 | |
| 65 | return formattedDate; |
| 66 | } |
| 67 | |
| 68 | export function prettyError(header: string, body?: string, footer?: string) { |
| 69 | const prefix = "Error: "; |
no test coverage detected
searching dependent graphs…