blob: fe01ca5edebbeb74951db1c731a1ba1bb536fd8e (
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: Date): 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 };
|