-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feat] date picker 구현 #96
The head ref may contain hidden characters: "90-feat-date-picker-\uAD6C\uD604"
Conversation
const formatDateToString = (date: Date) => { | ||
const year = date.getFullYear(); | ||
const month = (date.getMonth() + 1).toString().padStart(2, '0'); | ||
const day = date.getDate().toString().padStart(2, '0'); | ||
const dateString = `${year}.${month}.${day}`; | ||
return dateString; | ||
}; |
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.
이 부분은 머지 예정인 저의 다른 브랜치에 유틸함수로 분리되어있어서 해당 브랜치에서는 유틸함수로 따로 분리하진 않았습니다.
그 브랜치가 머지되면 이 부분 유틸함수 사용하는 것으로 수정할게요!
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.
LGTM !
public/index.ts
Outdated
export { default as CaretLeftIcon } from './svgs/caretLeft.svg'; | ||
export { default as CaretRightIcon } from './svgs/caretRight.svg'; |
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.
하나로 돌려써보기...? try..?
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.
오 저저거 안씀니다,, 쓰려고 추가하고서는 chevron으로 바꿧네요! 아마 저거 다른 파일에서 사용중일 거예요우
options={['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']} | ||
sizeVariant='xs' | ||
value={`${currentDate.getMonth() + 1}월`} | ||
onChange={(val) => handleMonthSelect(val)} |
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.
onChange={(val) => handleMonthSelect(val)} | |
onChange={(month) => handleMonthSelect(month)} |
알규먼트 이름은 작성하신 함수랑 맞춰주시는게 좋을거같아요
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.
오호,, 체크했슴다
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.
불이나케 달려왔지만 완벽한 코드였다,, 고생했어용!!!
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.
수고하셨습니다. 개인적으로 renderDays는 따로 분리하는 게 더 좋을 것 같아요!
|
||
interface CalendarProps { | ||
selectedDate: Date; | ||
setSelectedDate: Dispatch<SetStateAction<Date>>; |
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.
setState를 그대로 props로 넘기는 게 좋은 건지 고민해볼 필요가 있을 것 같습니다!
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.
그럼 혹시 이 부분 어떻게 해야할지 의견 주실 수 있으신가요,,? 저도 하면서 긴가민가,,
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.
부모에서 handler로 한 번 감싸서 핸들러를 보내는게 낫지 않을까 싶습니다?!
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.
오오옹오 네ㅔ넹!!! 열어분 덕에 많이 배워갑니다,,,
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.
캘린더를 직접 구현하는 여자.. 넘 멋쟈요👏👏
|
||
import { useState } from 'react'; | ||
import DatePicker from '@/components/DatePicker/DatePicker'; | ||
import type { DataPickerChangeProps } from '@/types/DatePickerTypes'; |
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.
오타났어용 ㅎㅎㅎ😉
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.
어머 진짜 눈썰미 대박 저 뭐가 틀린걸까,, 하구 5초 봤어여 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 감사합니동 🤭
@mixin day-wrapper-circle($background, $fontColor) { | ||
width: 3.3rem; | ||
height: 3.3rem; | ||
margin: auto; | ||
border-radius: 100%; | ||
background-color: $background; | ||
color: $fontColor; | ||
} |
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.
멋쪄용👍
import { useState } from 'react'; | ||
|
||
import { CalendarIcon } from '@/public/index'; | ||
import Button from '../Buttons/Button/Button'; |
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.
이거 배럴 있을텐데용?.?
onDateChane: (startDate: { startDate: Date; endDate: Date }) => void; | ||
} | ||
|
||
function DatePicker({ onDateChane }: DatePickerProps) { |
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.
onDateChange일까요?!
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 selectedEnd = new Date(currentDate); | ||
setSelectedMonthOption(month); | ||
|
||
selectedStart.setMonth(currentDate.getMonth() - month); |
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.
와옹 setMonth 처음 봐요!!👍👍
|
||
interface CalendarProps { | ||
selectedDate: Date; | ||
setSelectedDate: Dispatch<SetStateAction<Date>>; |
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.
부모에서 handler로 한 번 감싸서 핸들러를 보내는게 낫지 않을까 싶습니다?!
const handlePrevMonth = () => { | ||
const prevMonth = new Date(currentDate.setMonth(currentDate.getMonth() - 1)); | ||
setCurrentDate(new Date(prevMonth)); | ||
}; | ||
|
||
const handleNextMonth = () => { | ||
const nextMonth = new Date(currentDate.setMonth(currentDate.getMonth() + 1)); | ||
setCurrentDate(new Date(nextMonth)); | ||
}; |
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.
혹시 1월 이전이나 12월 이후는 클릭이 막혀있는지 궁금합니당!
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.
옷 아니용!! 안막혀있슴당 작년 재작년 내년 내후년 낸내내후년 모두 볼 수 있어용
🚀 작업 내용
📝 참고 사항
🖼️ 스크린샷
🚨 관련 이슈 (이슈 번호)
✅ 체크리스트