From 96e69ff32556619b64b6018fb90f64a40dbb7b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 3 Feb 2026 16:39:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=ED=99=88=ED=83=9D=EC=8A=A4=20=EB=A7=A4?= =?UTF-8?q?=EC=9E=85/=EB=A7=A4=EC=B6=9C=20=EA=B8=B0=EA=B0=84=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20Asia/Seoul=20=EC=8B=9C=EA=B0=84=EB=8C=80=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - formatLocalDate → formatKoreanDate: Asia/Seoul 시간대 기준 날짜 포맷 - getKoreanNow 함수 추가: 한국 시간대 기준 현재 날짜 반환 - getMonthDates: 한국 시간대 기준으로 월의 시작/종료일 계산 Co-Authored-By: Claude Opus 4.5 --- .../views/barobill/hometax/index.blade.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/resources/views/barobill/hometax/index.blade.php b/resources/views/barobill/hometax/index.blade.php index bbae6cf8..59edb60e 100644 --- a/resources/views/barobill/hometax/index.blade.php +++ b/resources/views/barobill/hometax/index.blade.php @@ -77,24 +77,28 @@ const CSRF_TOKEN = '{{ csrf_token() }}'; - // 로컬 타임존 기준 날짜 포맷 (YYYY-MM-DD) - 한국 시간 기준 - const formatLocalDate = (date) => { - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); - const day = String(date.getDate()).padStart(2, '0'); - return `${year}-${month}-${day}`; + // 한국 시간대(Asia/Seoul, UTC+9) 기준 날짜 포맷 (YYYY-MM-DD) + const formatKoreanDate = (date) => { + // en-CA 로케일은 YYYY-MM-DD 형식을 반환함 + return date.toLocaleDateString('en-CA', { timeZone: 'Asia/Seoul' }); }; - // 날짜 유틸리티 함수 + // 한국 시간대 기준 현재 날짜 가져오기 + const getKoreanNow = () => { + const koreaDateStr = new Date().toLocaleString('en-US', { timeZone: 'Asia/Seoul' }); + return new Date(koreaDateStr); + }; + + // 날짜 유틸리티 함수 - 한국 시간대(Asia/Seoul) 기준 const getMonthDates = (offset = 0) => { - const now = new Date(); + const now = getKoreanNow(); const year = now.getFullYear(); const month = now.getMonth() + offset; const firstDay = new Date(year, month, 1); const lastDay = new Date(year, month + 1, 0); return { - from: formatLocalDate(firstDay), - to: formatLocalDate(lastDay) + from: formatKoreanDate(firstDay), + to: formatKoreanDate(lastDay) }; };