코드수정정

This commit is contained in:
khj0414 2025-04-10 10:29:37 +09:00
parent f37c8ec947
commit 5b24a0254b

View File

@ -32,12 +32,10 @@
@error="setDefaultImage" @error="setDefaultImage"
/> />
</div> </div>
<!-- <div class="timeline-event ps-1" style="cursor: pointer;" @click="goVoteList()" > -->
<div class="timeline-event ps-1" style="cursor: pointer;" @click.stop="openModal(item.localVote.LOCVOTSEQ)" > <div class="timeline-event ps-1" style="cursor: pointer;" @click.stop="openModal(item.localVote.LOCVOTSEQ)" >
<div class="timeline-header "> <div class="timeline-header ">
<small ><strong>{{ truncateTitle(item.localVote.LOCVOTTTL) }}</strong></small> <small ><strong>{{ truncateTitle(item.localVote.LOCVOTTTL) }}</strong></small>
</div> </div>
<small class="d-flex align-items-center lh-1 me-4 mb-4 mb-sm-0" <small class="d-flex align-items-center lh-1 me-4 mb-4 mb-sm-0"
:style="{ color: getDaysAgo(item.localVote.formatted_LOCVOTEDT) == '금일 종료' ? 'red' : '' }"> :style="{ color: getDaysAgo(item.localVote.formatted_LOCVOTEDT) == '금일 종료' ? 'red' : '' }">
{{getDaysAgo(item.localVote.formatted_LOCVOTEDT)}}({{item.localVote.total_voted}}/{{ item.localVote.total_votable }}) {{getDaysAgo(item.localVote.formatted_LOCVOTEDT)}}({{item.localVote.total_voted}}/{{ item.localVote.total_votable }})
@ -53,7 +51,6 @@
<div class="card-body" v-else> <div class="card-body" v-else>
진행중인 투표가 없습니다. 진행중인 투표가 없습니다.
</div> </div>
</div> </div>
</div> </div>
<!--투표 모달 --> <!--투표 모달 -->
@ -229,13 +226,11 @@ const goVoteList = () =>{
const getDaysAgo = (dateString) => { const getDaysAgo = (dateString) => {
const inputDate = new Date(dateString); // Date const inputDate = new Date(dateString); // Date
const today = new Date(); // const today = new Date(); //
const input = new Date(inputDate.getFullYear(), inputDate.getMonth(), inputDate.getDate()); const input = new Date(inputDate.getFullYear(), inputDate.getMonth(), inputDate.getDate());
const now = new Date(today.getFullYear(), today.getMonth(), today.getDate()); const now = new Date(today.getFullYear(), today.getMonth(), today.getDate());
const timeDiff = now - input; const timeDiff = now - input;
const dayDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24)); const dayDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
// "" //
if (dayDiff === 0) return "금일 종료"; if (dayDiff === 0) return "금일 종료";
return `종료 ${Math.abs(dayDiff)}일 전`; return `종료 ${Math.abs(dayDiff)}일 전`;