-
Notifications
You must be signed in to change notification settings - Fork 0
클로드 가이드 추가 및 스터디 개설 날짜 수정 #373
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0187e6a
feat: TanStack Query 훅 작성 패턴 및 레거시 방식 추가
HA-SEUNG-JEONG 765b290
Merge branch 'develop' of https://github.com/code-zero-to-one/study-p…
HA-SEUNG-JEONG 47bc35e
feat: 날짜 유효성 검사 및 최소 날짜 설정 로직 추가
HA-SEUNG-JEONG 0c5acac
refactor: prettier 적용
HA-SEUNG-JEONG f089b42
style: 코드 포맷팅 개선 및 정렬 수정
HA-SEUNG-JEONG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 5392
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 5638
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 1441
🏁 Script executed:
# Check the full schema file to understand context wc -l src/features/study/group/model/group-study-form.schema.tsRepository: code-zero-to-one/study-platform-client
Length of output: 143
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 64
스키마의 로컬 타임존 해석으로 인한 KST 검증 불일치 해결 필요
UI에서
formatKoreaYMD(addDays(getKoreaDate(), 1))로 KST 기준 내일 날짜를 min 속성으로 설정하지만, 스키마의parseDate()는new Date(y, m-1, d)로 브라우저의 로컬 타임존으로 해석합니다. 따라서 KST가 아닌 다른 타임존의 사용자에게서는 검증 결과가 어긋납니다.YYYY-MM-DD 문자열 직접 비교로 타임존 해석을 완전히 제거하는 것이 안전합니다.
권장 수정안
if (ISO_DATE_REGEX.test(data.startDate)) { - const start = parseDate(data.startDate); - const today = new Date(); - const tomorrow = new Date( - today.getFullYear(), - today.getMonth(), - today.getDate() + 1, - ); - - if (start < tomorrow) { + const todayKst = getKoreaDate(); + const tomorrow = new Date(todayKst); + tomorrow.setDate(todayKst.getDate() + 1); + const toYmd = (d: Date) => + `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String( + d.getDate(), + ).padStart(2, '0')}`; + const tomorrowYmd = toYmd(tomorrow); + + if (data.startDate < tomorrowYmd) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: '스터디 시작일은 내일부터 설정할 수 있습니다.', path: ['startDate'], }); } } // 종료일은 시작일과 같거나 이후여야 함 if (ISO_DATE_REGEX.test(data.startDate) && ISO_DATE_REGEX.test(data.endDate)) { - const start = parseDate(data.startDate); - const end = parseDate(data.endDate); - if (end < start) { + if (data.endDate < data.startDate) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: '종료일은 시작일과 같거나 이후여야 합니다.', path: ['endDate'], }); } }상단에
import { getKoreaDate } from '@/utils/time';추가 필요.🤖 Prompt for AI Agents