feat(ticket): redesign audit timeline with structured history events
This commit is contained in:
@@ -4,4 +4,25 @@ export function formatDate(value: string | null | undefined) {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'short',
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
export function formatDateOnly(value: string | null | undefined) {
|
||||
if (!value) return '-';
|
||||
return new Intl.DateTimeFormat('en-IN', { dateStyle: 'medium' }).format(
|
||||
new Date(value),
|
||||
);
|
||||
}
|
||||
|
||||
export function formatTimelineDateTime(value: string | null | undefined) {
|
||||
if (!value) return { date: '-', time: '-' };
|
||||
|
||||
const parsed = new Date(value);
|
||||
return {
|
||||
date: new Intl.DateTimeFormat('en-IN', { dateStyle: 'medium' }).format(
|
||||
parsed,
|
||||
),
|
||||
time: new Intl.DateTimeFormat('en-IN', { timeStyle: 'short' }).format(
|
||||
parsed,
|
||||
),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user