3 lines
No EOL
201 B
TypeScript
3 lines
No EOL
201 B
TypeScript
export function dateFormatter(date: Date = new Date()): string {
|
|
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
|
} |