MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / formatDateTime

Function formatDateTime

apps/start/src/utils/date.ts:29–40  ·  view source on GitHub ↗
(date: Date)

Source from the content-addressed store, hash-verified

27}
28
29export function formatDateTime(date: Date) {
30 const datePart = formatDate(date);
31 const timePart = new Intl.DateTimeFormat(getLocale(), {
32 hour: '2-digit',
33 minute: '2-digit',
34 hour12: false,
35 year:
36 date.getFullYear() === new Date().getFullYear() ? undefined : 'numeric',
37 }).format(date);
38
39 return `${datePart}, ${timePart}`;
40}
41
42export function formatTime(date: Date) {
43 return new Intl.DateTimeFormat(getLocale(), {

Callers 7

ColumnCreatedAtFunction · 0.90
ProfilePropertiesFunction · 0.90
FieldValueFunction · 0.90
ComponentFunction · 0.90
ComponentFunction · 0.90
cellFunction · 0.90
formatTimeAgoOrDateTimeFunction · 0.85

Calls 2

getLocaleFunction · 0.85
formatDateFunction · 0.70

Tested by

no test coverage detected