We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2c718f commit 9736c07Copy full SHA for 9736c07
core/src/tools/format-date.ts
@@ -1,8 +1,7 @@
1
-export function formatDate(date: Date): string {
+import { format } from 'date-fns';
2
+
3
- const day: string = date.getDate().toString().padStart(2, '0');
4
- const month: string = (date.getMonth() + 1).toString().padStart(2, '0');
5
- const year: string = date.getFullYear().toString();
+export function formatDate(date: Date): string {
6
7
- return `${day}.${month}.${year}`;
+ return format(date, 'dd.MM.yyyy');
8
}
0 commit comments