-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π¨ refactor: λ μ§ ν¬λ§· ν¨μ formatDate 리ν©ν λ§
- Loading branch information
1 parent
2eddc15
commit a394dc1
Showing
2 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
const formatDate = (date: Date) => { | ||
const formatDate = (date: Date): string => { | ||
const year = date.getFullYear().toString().substring(2, 4); | ||
const month = (date.getMonth() + 1).toString().padStart(2, '0'); | ||
const day = date.getDate().toString().padStart(2, '0'); | ||
|
||
return `${year}λ ${month}μ ${day}μΌμ λ°μ νΈμ§`; | ||
return `${year}λ ${month}μ ${day}μΌ`; | ||
}; | ||
|
||
export default formatDate; | ||
const inboxDate = (date: Date): string => { | ||
return `${formatDate(date)}μ λ°μ νΈμ§`; | ||
}; | ||
|
||
const sendDate = (date: Date): string => { | ||
return formatDate(date); | ||
}; | ||
|
||
export { inboxDate, sendDate }; |