-
Notifications
You must be signed in to change notification settings - Fork 1
Fix: 리마인드 비교기준 now 시간 UST->KST #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -169,7 +169,12 @@ const MainPop = ({ type, savedData }: MainPopProps) => { | |||||||||||||||||||||||
| const handleSwitchChange = (checked: boolean) => { | ||||||||||||||||||||||||
| setIsRemindOn(checked); | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| function getKSTISOString() { | ||||||||||||||||||||||||
| const now = new Date(); | ||||||||||||||||||||||||
| const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위) | ||||||||||||||||||||||||
| const kst = new Date(now.getTime() - offset); // UTC → KST 보정 | ||||||||||||||||||||||||
| return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+172
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. KST 변환 로직 오류 수정 필요 getKSTISOString() 함수의 KST 변환 로직이 잘못되었습니다:
다음 diff를 적용하여 올바른 KST 변환을 구현하세요: function getKSTISOString() {
const now = new Date();
- const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위)
- const kst = new Date(now.getTime() - offset); // UTC → KST 보정
+ const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9)
return kst.toISOString().slice(0, 19); // 밀리초, Z 제거
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| // 마지막! 저장하기 버튼 분기 (api 다르게 탐) | ||||||||||||||||||||||||
| const handleSave = async () => { | ||||||||||||||||||||||||
| const currentDate = date; | ||||||||||||||||||||||||
|
|
@@ -188,7 +193,7 @@ const MainPop = ({ type, savedData }: MainPopProps) => { | |||||||||||||||||||||||
| selectedCategory: selected, | ||||||||||||||||||||||||
| date: isRemindOn ? currentDate : date, | ||||||||||||||||||||||||
| time: isRemindOn ? currentTime : time, | ||||||||||||||||||||||||
| createdAt: new Date().toISOString(), | ||||||||||||||||||||||||
| createdAt: getKSTISOString(), | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (type === 'add') { | ||||||||||||||||||||||||
|
|
@@ -222,7 +227,7 @@ const MainPop = ({ type, savedData }: MainPopProps) => { | |||||||||||||||||||||||
| ? parseInt(saveData.selectedCategory) | ||||||||||||||||||||||||
| : 0, | ||||||||||||||||||||||||
| memo: saveData.memo, | ||||||||||||||||||||||||
| now: new Date().toISOString(), | ||||||||||||||||||||||||
| now: getKSTISOString(), | ||||||||||||||||||||||||
| remindTime: isRemindOn | ||||||||||||||||||||||||
| ? combineDateTime(saveData.date ?? '', saveData.time ?? '') | ||||||||||||||||||||||||
| : null, | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,7 +42,10 @@ | |||||||||
| "node": ">=18" | ||||||||||
| }, | ||||||||||
| "dependencies": { | ||||||||||
| "@swc/helpers": "^0.5.17", | ||||||||||
| "@tanstack/react-query": "^5.87.4", | ||||||||||
| "@types/react-router-dom": "^5.3.3", | ||||||||||
| "react-router-dom": "^7.8.2" | ||||||||||
| "react-router-dom": "^7.8.2", | ||||||||||
|
Comment on lines
47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. React Router DOM 버전과 타입 정의가 불일치합니다
- "@types/react-router-dom": "^5.3.3",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| "yaml": "^2.4.2" | ||||||||||
| } | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KST 변환 로직 오류 수정 필요
MainPop.tsx와 동일한 KST 변환 로직 오류가 있습니다:
now.getTime() - offset로직이 잘못되었습니다getTimezoneOffset()은 UTC 서쪽 타임존에 대해 양수 값을 반환합니다다음 diff를 적용하세요:
function getKSTISOString() { const now = new Date(); - const offset = now.getTimezoneOffset() * 60000; // UTC 기준 오프셋 (분 단위) - const kst = new Date(now.getTime() - offset); // UTC → KST 보정 + const kst = new Date(now.getTime() + (9 * 60 * 60000)); // UTC → KST (UTC+9) return kst.toISOString().slice(0, 19); // 밀리초, Z 제거 }참고: 이 함수는 MainPop.tsx와 중복되므로, 수정 후 공통 유틸리티로 추출하는 것을 권장합니다(MainPop.tsx 리뷰 참조).
📝 Committable suggestion
🤖 Prompt for AI Agents