From 968afd95a6a7eb053a3705fcacdc4b3a485fc2de Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sat, 25 Oct 2025 13:14:35 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AA=A8=EB=93=A0=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC=EB=A5=BC=20=ED=95=9C=EA=B5=AD=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84(KST)=20=EA=B8=B0=EC=A4=80=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ‡ฐ๐Ÿ‡ท Korean Standard Time (KST) Implementation: - UTC+9 ์‹œ๊ฐ„๋Œ€๋กœ ๋ชจ๋“  ์‹œ๊ฐ„ ์ฒ˜๋ฆฌ ํ†ต์ผ - ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ๊ฐ„ ์‹œ๊ฐ„ ๊ธฐ์ค€ ์ผ์น˜ ๐Ÿ• KST Utility Functions: - getKSTDate(): UTC โ†’ KST ๋ณ€ํ™˜ ํ•จ์ˆ˜ - formatKSTDate(): KST ๊ธฐ์ค€ ๋‚ ์งœ ํฌ๋งทํŒ… (2024. 10. 25.) - formatKSTTime(): KST ๊ธฐ์ค€ ์‹œ๊ฐ„ ํฌ๋งทํŒ… (14:30) - getKSTToday(): KST ๊ธฐ์ค€ ์˜ค๋Š˜ ๋‚ ์งœ ๋ฐ˜ํ™˜ โฐ Time Display Improvements: - ์—…๋กœ๋“œ ์‹œ๊ฐ„: KST ๊ธฐ์ค€ ๋‚ ์งœ + ์‹œ๊ฐ„ ํ‘œ์‹œ - ์ƒ๋Œ€ ์‹œ๊ฐ„: '2์‹œ๊ฐ„ ์ „' ๋“ฑ๋„ KST ๊ธฐ์ค€์œผ๋กœ ๊ณ„์‚ฐ - getTimeAgo(): KST ๊ธฐ์ค€ ์‹œ๊ฐ„ ์ฐจ์ด ๊ณ„์‚ฐ ๐Ÿ“Š Statistics Calculation (KST-based): - ๊ธˆ์ผ ์‹ ๊ทœ: KST ๊ธฐ์ค€ ์˜ค๋Š˜ 00:00 ์ดํ›„ ๋“ฑ๋ก - ๋ฏธํ•ด๊ฒฐ: KST ๊ธฐ์ค€ ์˜ค๋Š˜ ์ด์ „ ๋“ฑ๋ก๋œ ๊ฑด - ํ†ต๊ณ„ ๋กœ๊ทธ์— KST ๊ธฐ์ค€ ๋‚ ์งœ ์ •๋ณด ํฌํ•จ ๐Ÿ”ง Technical Implementation: - timeZone: 'Asia/Seoul' ๋ช…์‹œ์  ์„ค์ • - UTC + 9์‹œ๊ฐ„ ์˜คํ”„์…‹ ๊ณ„์‚ฐ - ๋ชจ๋“  ๋‚ ์งœ ๋น„๊ต๋ฅผ KST ๊ธฐ์ค€์œผ๋กœ ํ†ต์ผ ๐ŸŒ Timezone Consistency: - ์„œ๋ฒ„ KST โ†” ํด๋ผ์ด์–ธํŠธ KST ์ผ์น˜ - ์‚ฌ์šฉ์ž ์œ„์น˜์™€ ๊ด€๊ณ„์—†์ด ํ•œ๊ตญ ์‹œ๊ฐ„ ๊ธฐ์ค€ - ํ†ต๊ณ„ ๋ฐ ํ•„ํ„ฐ๋ง ์ •ํ™•์„ฑ ํ–ฅ์ƒ Expected Result: โœ… ๋ชจ๋“  ์‹œ๊ฐ„์ด ํ•œ๊ตญ ์‹œ๊ฐ„(KST) ๊ธฐ์ค€์œผ๋กœ ํ‘œ์‹œ โœ… ์˜ค๋Š˜/์–ด์ œ ๊ตฌ๋ถ„์ด ํ•œ๊ตญ ์‹œ๊ฐ„ ๊ธฐ์ค€์œผ๋กœ ์ •ํ™•ํžˆ ์ž‘๋™ โœ… ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ์‹œ๊ฐ„ ๊ธฐ์ค€ ์ผ์น˜ โœ… ์‚ฌ์šฉ์ž ์œ„์น˜์™€ ๋ฌด๊ด€ํ•œ ์ผ๊ด€๋œ ์‹œ๊ฐ„ ํ‘œ์‹œ --- frontend/issues-inbox.html | 63 ++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 16 deletions(-) diff --git a/frontend/issues-inbox.html b/frontend/issues-inbox.html index 8e5dddf..c409e18 100644 --- a/frontend/issues-inbox.html +++ b/frontend/issues-inbox.html @@ -386,6 +386,33 @@ let issues = []; let projects = []; let filteredIssues = []; + + // ํ•œ๊ตญ ์‹œ๊ฐ„(KST) ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜ + function getKSTDate(date) { + const utcDate = new Date(date); + // UTC + 9์‹œ๊ฐ„ = KST + return new Date(utcDate.getTime() + (9 * 60 * 60 * 1000)); + } + + function formatKSTDate(date) { + const kstDate = getKSTDate(date); + return kstDate.toLocaleDateString('ko-KR', { timeZone: 'Asia/Seoul' }); + } + + function formatKSTTime(date) { + const kstDate = getKSTDate(date); + return kstDate.toLocaleTimeString('ko-KR', { + timeZone: 'Asia/Seoul', + hour: '2-digit', + minute: '2-digit' + }); + } + + function getKSTToday() { + const now = new Date(); + const kstNow = getKSTDate(now); + return new Date(kstNow.getFullYear(), kstNow.getMonth(), kstNow.getDate()); + } // ์• ๋‹ˆ๋ฉ”์ด์…˜ ํ•จ์ˆ˜๋“ค function animateHeaderAppearance() { @@ -639,8 +666,8 @@ container.innerHTML = filteredIssues.map(issue => { const project = projects.find(p => p.id === issue.project_id); const reportDate = new Date(issue.report_date); - const createdDate = reportDate.toLocaleDateString('ko-KR'); - const createdTime = reportDate.toLocaleTimeString('ko-KR', { hour: '2-digit', minute: '2-digit' }); + const createdDate = formatKSTDate(reportDate); + const createdTime = formatKSTTime(reportDate); const timeAgo = getTimeAgo(reportDate); // ์‚ฌ์ง„ ์ •๋ณด ์ฒ˜๋ฆฌ @@ -728,17 +755,18 @@ // ํ†ต๊ณ„ ๋กœ๋“œ (์ƒˆ๋กœ์šด ๊ธฐ์ค€) async function loadStatistics() { try { - // ํ˜„์žฌ ์ˆ˜์‹ ํ•จ ์ด์Šˆ๋“ค์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ†ต๊ณ„ ๊ณ„์‚ฐ - const today = new Date(); - const todayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate()); + // ํ˜„์žฌ ์ˆ˜์‹ ํ•จ ์ด์Šˆ๋“ค์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ†ต๊ณ„ ๊ณ„์‚ฐ (KST ๊ธฐ์ค€) + const todayStart = getKSTToday(); + console.log('๐Ÿ“… KST ๊ธฐ์ค€ ์˜ค๋Š˜ ์‹œ์ž‘:', todayStart); // ์ „์ฒด: ์ˆ˜์‹ ํ•จ์— ๋‚จ์•„์žˆ๋Š” ๋ชฉ๋ก ๊ฐœ์ˆ˜ (pending_review ์ƒํƒœ) const totalCount = issues.length; - // ๊ธˆ์ผ ์‹ ๊ทœ: ์˜ค๋Š˜ ์˜ฌ๋ผ์˜จ ๋ชฉ๋ก ์ˆซ์ž (ํ™•์ธ๋œ ๊ฒƒ ํฌํ•จ) + // ๊ธˆ์ผ ์‹ ๊ทœ: ์˜ค๋Š˜ ์˜ฌ๋ผ์˜จ ๋ชฉ๋ก ์ˆซ์ž (ํ™•์ธ๋œ ๊ฒƒ ํฌํ•จ) - KST ๊ธฐ์ค€ const todayNewCount = issues.filter(issue => { - const reportDate = new Date(issue.report_date); - return reportDate >= todayStart; + const reportDate = getKSTDate(new Date(issue.report_date)); + const reportDateOnly = new Date(reportDate.getFullYear(), reportDate.getMonth(), reportDate.getDate()); + return reportDateOnly >= todayStart; }).length; // ๊ธˆ์ผ ์ฒ˜๋ฆฌ: ์˜ค๋Š˜ ์ฒ˜๋ฆฌ๋œ ๊ฑด์ˆ˜ (API์—์„œ ๊ฐ€์ ธ์™€์•ผ ํ•จ) @@ -758,10 +786,11 @@ console.log('์ฒ˜๋ฆฌ๋œ ๊ฑด์ˆ˜ ์กฐํšŒ ์‹คํŒจ:', e); } - // ๋ฏธํ•ด๊ฒฐ: ์˜ค๋Š˜๊บผ ์ œ์™ธํ•œ ๋‚จ์•„์žˆ๋Š” ๊ฒƒ๋“ค + // ๋ฏธํ•ด๊ฒฐ: ์˜ค๋Š˜๊บผ ์ œ์™ธํ•œ ๋‚จ์•„์žˆ๋Š” ๊ฒƒ๋“ค - KST ๊ธฐ์ค€ const unresolvedCount = issues.filter(issue => { - const reportDate = new Date(issue.report_date); - return reportDate < todayStart; + const reportDate = getKSTDate(new Date(issue.report_date)); + const reportDateOnly = new Date(reportDate.getFullYear(), reportDate.getMonth(), reportDate.getDate()); + return reportDateOnly < todayStart; }).length; // ํ†ต๊ณ„ ์—…๋ฐ์ดํŠธ @@ -770,11 +799,12 @@ document.getElementById('todayProcessedCount').textContent = todayProcessedCount; document.getElementById('unresolvedCount').textContent = unresolvedCount; - console.log('๐Ÿ“Š ํ†ต๊ณ„ ์—…๋ฐ์ดํŠธ:', { + console.log('๐Ÿ“Š ํ†ต๊ณ„ ์—…๋ฐ์ดํŠธ (KST ๊ธฐ์ค€):', { ์ „์ฒด: totalCount, ๊ธˆ์ผ์‹ ๊ทœ: todayNewCount, ๊ธˆ์ผ์ฒ˜๋ฆฌ: todayProcessedCount, - ๋ฏธํ•ด๊ฒฐ: unresolvedCount + ๋ฏธํ•ด๊ฒฐ: unresolvedCount, + ๊ธฐ์ค€์ผ: formatKSTDate(new Date()) }); } catch (error) { @@ -1062,8 +1092,9 @@ } function getTimeAgo(date) { - const now = new Date(); - const diffMs = now - date; + const now = getKSTDate(new Date()); + const kstDate = getKSTDate(date); + const diffMs = now - kstDate; const diffMins = Math.floor(diffMs / 60000); const diffHours = Math.floor(diffMs / 3600000); const diffDays = Math.floor(diffMs / 86400000); @@ -1072,7 +1103,7 @@ if (diffMins < 60) return `${diffMins}๋ถ„ ์ „`; if (diffHours < 24) return `${diffHours}์‹œ๊ฐ„ ์ „`; if (diffDays < 7) return `${diffDays}์ผ ์ „`; - return date.toLocaleDateString('ko-KR'); + return formatKSTDate(date); } function showLoading(show) {