jatui

Utilities

Date formatters, currency, phone, task display helpers — live examples

Date formatters

InputformatRelativeTimeformatDateTimeformatShortDate
1 minute ago1mJul 3, 7:32 PMJul 3
3 hours ago3hJul 3, 4:33 PMJul 3
2 days ago2dJul 1, 7:33 PMJul 1
10 days ago1wJun 23, 7:33 PMJun 23
6 weeks ago1moMay 22, 7:33 PMMay 22

formatFullDate adds the year: Jun 23, 2026, 07:33 PM

taskAge

Returns a { label, color } pair — a compact age label with a traffic-light oklch color (green=fresh, blue=recent, amber=aging, orange/red=stale).

1m 1 minute ago
3h 3 hours ago
2d 2 days ago
1w 10 days ago
1mo 6 weeks ago

Task display helpers

statusColor + statusLabel

OpenIn ProgressWaitingReviewBlockedClosedDeployed

priorityColor

lowmediumhighcritical

typeIcon (deprecated — use TaskTypeIcon component)

📋 task🐛 bugfeature🏔️ epic

Prefer <TaskTypeIcon type="bug" /> — it renders an SVG that inherits currentColor and avoids emoji cross-OS drift.

formatCurrency

$0.00
$1.50
$42.00
$1,234.56
$99,999.99

Phone formatting

InputformatPhoneNumber (US, masked)formatPhoneForDisplay (E.164 → readable)
5615551234(561) 555-1234(561) 555-1234
2125550100(212) 555-0100(212) 555-0100
8005551234(800) 555-1234(800) 555-1234

formatPhoneNumber is a US-only helper. For international numbers use formatPhoneForDisplay (E.164 input → human-readable display).

API reference

ExportSignatureDescription
formatRelativeTime(date) → stringCompact relative: "3h", "2d", "4w", "6mo"
formatDateTime(date) → string"Jan 5, 2:30 PM" (no year)
formatFullDate(date) → string"Jan 5, 2025, 02:30 PM"
formatShortDate(date) → string"Jan 5"
taskAge(isoString) → { label, color }Traffic-light label+color pair
statusColor(status) → stringDaisyUI badge class for task status
statusLabel(status) → string"in_progress" → "In Progress"
priorityColor(priority) → stringTailwind text class for priority
typeIcon(type) → stringEmoji icon — deprecated, use TaskTypeIcon
formatCurrency(amount) → string"$1,234.56" (USD)
formatPhoneNumber(digits) → stringUS phone mask: "(561) 555-1234"
formatPhoneForDisplay(e164) → stringE.164 → human-readable