Skip to content

Commit

Permalink
refactoring: data formatting export
Browse files Browse the repository at this point in the history
  • Loading branch information
yuni committed Apr 30, 2024
1 parent daeea43 commit 556745f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/src/utils/dateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ export const formatHoliday = (date) => {
const month = `0${date.getMonth() + 1}`.slice(-2)
return { year, month }
}

export const formatDate = (date) => {
const weekDays = ['일', '월', '화', '수', '목', '금', '토']
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const weekDay = weekDays[date.getDay()]

return `${year}${month}${day}일 (${weekDay})`
}

0 comments on commit 556745f

Please sign in to comment.