From 5b24a0254b7bf95188b838651a08f6bf3a1f0ed6 Mon Sep 17 00:00:00 2001 From: khj0414 Date: Thu, 10 Apr 2025 10:29:37 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=94=EB=93=9C=EC=88=98=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/MainVote.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/main/MainVote.vue b/src/components/main/MainVote.vue index ed973f1..3e3161c 100644 --- a/src/components/main/MainVote.vue +++ b/src/components/main/MainVote.vue @@ -32,12 +32,10 @@ @error="setDefaultImage" /> -
{{ truncateTitle(item.localVote.LOCVOTTTL) }}
- ⏰{{getDaysAgo(item.localVote.formatted_LOCVOTEDT)}}({{item.localVote.total_voted}}/{{ item.localVote.total_votable }}) @@ -53,7 +51,6 @@
진행중인 투표가 없습니다.
-
@@ -211,7 +208,7 @@ const voteDelete =(id) =>{ } // 제목이 14글자 넘어가면 ... 처리하는 함수 const truncateTitle = title => { -return title.length > 10 ? title.slice(0, 10) + '...' : title; + return title.length > 10 ? title.slice(0, 10) + '...' : title; }; //투표이동 @@ -229,13 +226,11 @@ const goVoteList = () =>{ const getDaysAgo = (dateString) => { const inputDate = new Date(dateString); // 문자열을 Date 객체로 변환 const today = new Date(); // 현재 날짜 가져오기 - const input = new Date(inputDate.getFullYear(), inputDate.getMonth(), inputDate.getDate()); const now = new Date(today.getFullYear(), today.getMonth(), today.getDate()); - const timeDiff = now - input; const dayDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24)); - // 오늘 날짜인 경우 "오늘" 반환 + // 오늘 날짜인 경우 if (dayDiff === 0) return "금일 종료"; return `종료 ${Math.abs(dayDiff)}일 전`;