blob: 0c1cecc0b830510563f7dde1f54c94561f22a3f7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// Format date to a string
function formatDate(date: string): string {
const options: Intl.DateTimeFormatOptions = {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
};
return new Date(date).toLocaleDateString(undefined, options);
}
export { formatDate };
|