8 lines
327 B
TypeScript
8 lines
327 B
TypeScript
export class DateDisplay {
|
|
static formatShort(date: string | Date): string {
|
|
const d = typeof date === 'string' ? new Date(date) : date;
|
|
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
return `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
|
|
}
|
|
}
|