-
Notifications
You must be signed in to change notification settings - Fork 4
[feat] 날짜 및 시간 유틸 함수 구현 #17
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
Conversation
✅ Deploy Preview for thejulge1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
jeonghwanJay
left a comment
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.
수고하셨습니다 !
cozy-ito
left a comment
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.
늦게 리뷰 드려서 죄송합니다 🙇♂️
고생하셨습니다! 👍
src/utils/datetime.ts
Outdated
| // 시작 시간 + workhour 기준으로 endTime까지 포함한 시간 범위 문자열 | ||
| export function formatTimeRange(startsAt: string, workhour: number): string { | ||
| const start = new Date(startsAt); | ||
| const end = new Date(start.getTime() + workhour * 3600000); |
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.
- 매직넘버는 별도의 상수화를 통해서 그 의미를 전달하면 좋을 것 같습니다 🤔
const ONE_MINUTE = 3_600_000;
...
const end = new Date(start.getTime() + workhour * ONE_MINUTE);- 언더스코어(
_)를 통해서 숫자 구분을 해도 좋을 것 같아요! 숫자 데이터와 동일하게 취급돼요! 😄 (ex:3_600_000)
| }); | ||
| } | ||
| // 시작 시간 + workhour 기준으로 endTime까지 포함한 시간 범위 문자열 | ||
| export function formatTimeRange(startsAt: string, workhour: number): string { |
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.
그냥 단순히 궁금한 부분입니다만,
왜 startAt이 아니라 startsAt인가요..! 😅
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.
그리고 입력받는 startsAt이 string타입이라면
전달 받아야 하는 특정 형태가 있을까요? 🤔 (ex: YYYY-MM-DD HH:mm 등)
있다면 JSDoc을 사용해서 어떤 형태로 전달 받아야 하는지에 대한 설명이 포함되면 좋겠어요! 👍
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.
api 리스폰스가 startsAt으로 오는 것 같아서 startsAt으로 지정하기는 했습니다..!😊
#️⃣연관된 이슈
Closes #16
📝 PR 유형
📝작업 내용
스크린샷 (선택)
💬리뷰 요구사항(선택)