-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feature] 캘린더 컴포넌트를 구현합니다. #19
Conversation
- 캘린더 헤더(연 달 표시, 이전 달 다음 달 버튼) - 캘린더 요일 표시
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.
캘린더 기능 개발하시느라 고생 많이 하셨습니다 쭉 코드를 정독해보았고 몇가지 코멘트를 작성 하였는데 확인해주시면 좋을 것 같습니다.
|
||
class Calendar( | ||
initDate: LocalDate = LocalDate.now(), | ||
private val dateTimeFormatter: DateTimeFormatter = | ||
DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT_PATTERN), | ||
DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT_PATTERN).withLocale(Locale.ENGLISH), |
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.
Locale.ENGLISH 를 적용하신 이유가 무엇인가요?
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월 2024
이런식으로 디바이스의 언어설정 기준으로 들어가게 됩니다.
디자인상으로 의도된건 Jan 2024
와 같은 영어약어의 표현이기 때문에 해당 Locale 설정을 추가하였습니다.
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.
오 디바이스 언어를 인식하는줄은 몰랐습니다! 새로운 사실을 배워가네요
Row(modifier = Modifier.padding(bottom = 8.dp)) { | ||
DayOfWeek.entries.forEach { dayOfWeek -> | ||
DayOfWeek( | ||
name = dayOfWeek.abbreviation, | ||
modifier = Modifier.weight(1f), | ||
) | ||
} | ||
} | ||
LazyVerticalGrid( | ||
columns = GridCells.Fixed(7), | ||
verticalArrangement = Arrangement.spacedBy(DAY_DEFAULT_MARGIN.dp), | ||
horizontalArrangement = Arrangement.spacedBy(DAY_DEFAULT_MARGIN.dp), | ||
) { | ||
items((days.first().date.dayOfWeek.ordinal + 1) % 7) { | ||
Box(modifier = Modifier.weight(1f)) | ||
} | ||
|
||
items(days) { | ||
Day(studyDay = it, modifier = Modifier.weight(1f)) | ||
} | ||
} |
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.
반영완료 하였습니다. 가독성을 위한 분리를 해보고 추후 장단점을 피부로 같이 느껴보는 시간을 가졌음 좋겠습니다!
Then("윤년이기 때문에 1부터 29일까지 반환된다.") { | ||
actual = calendar.getMonth() | ||
actual.first().date shouldBe LocalDate.of(2024, 2, 1) | ||
actual.last().date shouldBe LocalDate.of(2024, 2, 29) | ||
} |
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.
워낙에 애초에 잘 짜여진 Java의 라이브러리다 보니 엣지케이스 위주로 테스트를 진행하였습니다!
추가적으로 월을 표기하는 곳에 디자인 변경사항이 발생했으니 그것도 반영해주시면 좋을 것 같습니다. |
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.
의견 토론해주셔서 감사합니다 수고하셨습니다!
resolved #15
AS-IS
TO-BE
KEY-POINT
SCREENSHOT (Optional)