diff --git a/src/common/formattedDate.js b/src/common/formattedDate.js new file mode 100644 index 0000000..01956d6 --- /dev/null +++ b/src/common/formattedDate.js @@ -0,0 +1,13 @@ +/** 날짜 포맷1 (YYYY-MM-DD HH:MM) */ +export const formattedDate = (dateString) => { + if (!dateString) return "날짜 없음"; + const dateObj = new Date(dateString); + return `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, '0')}-${String(dateObj.getDate()).padStart(2, '0')} ${String(dateObj.getHours()).padStart(2, '0')}:${String(dateObj.getMinutes()).padStart(2, '0')}`; +}; + +/** 날짜 포맷2 (YYYY-MM-DD) */ +export const formatDate = (dateString) => { + if (!dateString) return "날짜 없음"; + const dateObj = new Date(dateString); + return `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, '0')}-${String(dateObj.getDate()).padStart(2, '0')}`; +}; diff --git a/src/components/modal/VacationModal.vue b/src/components/modal/VacationModal.vue index c8e22f2..d57e482 100644 --- a/src/components/modal/VacationModal.vue +++ b/src/components/modal/VacationModal.vue @@ -41,6 +41,7 @@