Skip to content

Commit 3da28e6

Browse files
committed
feat: create date formatting util
#19
1 parent e84318d commit 3da28e6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/utils/date.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function formatDate(date: Date): string {
2+
const year = date.getFullYear();
3+
const month = String(date.getMonth() + 1).padStart(2, '0');
4+
const day = String(date.getDate()).padStart(2, '0');
5+
6+
return `${year}-${month}-${day}`;
7+
}

0 commit comments

Comments
 (0)