diff --git a/src/common/common.js b/src/common/common.js index 24dcf2d..4ed7af5 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -76,6 +76,34 @@ const common = { }; }, + // 오늘 날짜시간 조회 + getToday() { + const date = new Date(); + return { + year: date.getFullYear(), + month: date.getMonth() + 1, + day: date.getDate(), + hours: date.getHours(), + minutes: date.getMinutes(), + seconds: date.getSeconds(), + }; + }, + + // 해당 월, 일에 맞는 목록 필터링 + filterTargetByDate(target, key, month, day) { + if (!Array.isArray(target) || target.length === 0) return []; + + return [...target].filter(item => { + if (!item[key]) return false; + + const date = new Date(item[key]); + const MatchingMonth = date.getMonth() + 1 === parseInt(month, 10); + const MatchingDay = date.getDate() === parseInt(day, 10); + + return MatchingMonth && MatchingDay; + }); + }, + /** * 빈값 확인 * @@ -83,9 +111,17 @@ const common = { * @returns */ isNotEmpty(obj) { - if (obj === null || obj === undefined) return false; - if (typeof obj === 'string' && obj.trim() === '') return false; - if ((Array.isArray(obj) || obj === Object(obj)) && Object.keys(obj).length === 0) return false; + if (obj === null || obj === undefined) { + return false; + } + + if (typeof obj === 'string' && obj.trim() === '') { + return false; + } + + if ((Array.isArray(obj) || obj === Object(obj)) && Object.keys(obj).length === 0) { + return false; + } return true; }, diff --git a/src/components/main/MainCalendar.vue b/src/components/main/MainCalendar.vue index 9f6788d..65ecac2 100644 --- a/src/components/main/MainCalendar.vue +++ b/src/components/main/MainCalendar.vue @@ -23,7 +23,12 @@ ref="workTimeComponentRef" /> - + -
- User Profile -
- -
- User Profile -
- -
- User Profile -
- -
- User Profile -
+ + @@ -57,7 +45,7 @@