MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / parseTimestamp

Function parseTimestamp

apps/mobile/src/lib/utils.ts:13–21  ·  view source on GitHub ↗

* Parse a Drizzle `mode: 'string'` timestamp into a Date. * Hermes can't parse PostgreSQL's default format (`2026-03-13 14:30:00+00`), * so we normalise the space separator to `T` before parsing.

(value: string)

Source from the content-addressed store, hash-verified

11}
12
13// Ordered largest-first so the first unit whose bucket fits wins; the values
14// mirror the original minute/hour/day/month/year buckets.
15const RELATIVE_TIME_UNITS: readonly { unit: Intl.RelativeTimeFormatUnit; seconds: number }[] = [
16 { unit: 'year', seconds: 365 * 24 * 60 * 60 },
17 { unit: 'month', seconds: 30 * 24 * 60 * 60 },
18 { unit: 'day', seconds: 24 * 60 * 60 },
19 { unit: 'hour', seconds: 60 * 60 },
20 { unit: 'minute', seconds: 60 },
21];
22
23/**
24 * Returns a human-readable relative time string like "3 days ago" or "in 2

Callers 8

CreditsCardFunction · 0.90
sortByUpdatedFunction · 0.90
storedSessionMetaFunction · 0.90
formatMetaFunction · 0.90
groupSessionsByDateFunction · 0.90
formatBillingDateFunction · 0.90
renderVersionItemFunction · 0.90

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected