MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / initTimestampFormatter

Function initTimestampFormatter

cli/src/utils/helpers.ts:2–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1let timestampFormatter: Intl.DateTimeFormat | null = null
2export function initTimestampFormatter() {
3 if (timestampFormatter) return
4 try {
5 timestampFormatter = new Intl.DateTimeFormat(undefined, {
6 hour: '2-digit',
7 minute: '2-digit',
8 })
9 } catch {
10 timestampFormatter = null
11 }
12}
13
14export function formatTimestamp(date = new Date()): string {
15 if (timestampFormatter) {

Callers 1

initializeAppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected