Skip to content

Commit

Permalink
Feat: 날짜 변환 함수 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
KKangHHee committed Jun 2, 2024
1 parent 264ee94 commit 0373cf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/components/Login/GoogleLogin.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions src/utils/formatDate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export function formatDate(isoDate: string) {
const date = new Date(isoDate);
const year = date.getFullYear().toString().slice(2); // 년도에서 앞 2자리만 추출
const month = String(date.getMonth() + 1).padStart(2, "0"); // 월을 2자리로 변환하고 앞에 0을 채움
const day = String(date.getDate()).padStart(2, "0"); // 일을 2자리로 변환하고 앞에 0을 채움
const hours = String(date.getHours()).padStart(2, "0"); // 시를 2자리로 변환하고 앞에 0을 채움
const minutes = String(date.getMinutes()).padStart(2, "0"); // 분을 2자리로 변환하고 앞에 0을 채움

return `${year}.${month}.${day}, ${hours}${minutes}분`;
}

0 comments on commit 0373cf3

Please sign in to comment.