Skip to content
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

[TNT-180] 트레이니 주간 캘린더 연동 #67

Merged
merged 9 commits into from
Feb 8, 2025

Conversation

SeonJeongk
Copy link
Contributor

📝 작업 내용

📸 실행 화면

TraineeHomeWeekCalendar.mp4

🙆🏻 리뷰 요청 사항

없습니다!

👀 레퍼런스

@SeonJeongk SeonJeongk added ✨ Feat 기능 구현 🌻 선정 김씨 집안 막내 김선정 labels Feb 7, 2025
@SeonJeongk SeonJeongk added this to the 3차 스프린트 milestone Feb 7, 2025
@SeonJeongk SeonJeongk self-assigned this Feb 7, 2025
@github-actions github-actions bot requested a review from hoyahozz February 7, 2025 09:23
Copy link
Member

@hoyahozz hoyahozz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기획에 맞게 캘린더 조정이 필요할 것으로 보입니다 !_!

val now = LocalDate.now()
val coroutineScope = rememberCoroutineScope()

val weekCalendarState = rememberWeekCalendarState(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우리 앱의 첫번째 요일은 '일요일'이므로 별도로 FirstDayOfWeek 선언해주는게 좋을 것 같습니다 ~

.padding(horizontal = 20.dp, vertical = 8.dp),
) {
Spacer(Modifier.height(8.dp))
TnTCalendarSelector(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 제 브랜치에서 TnTHomeTopBar 만들어뒀어요! 체리픽해서 사용하면 조을 것 같습니당

}
Spacer(modifier = Modifier.height(16.dp))
TnTIndicatorWeekCalendar(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최소 날짜, 최대 날짜 지정이 필요할 것 같습니다!

}
}

private fun moveToNextWeek() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7일 중 과반 이상(4개 이상)이 해당하는 년도-월로 표시

현재 보이는 '연월'은 위 기획과 동일하게 설정되도록 수정이 필요할 것 같아요!

@SeonJeongk SeonJeongk requested a review from hoyahozz February 8, 2025 13:05
Copy link
Member

@hoyahozz hoyahozz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOOD 👍👍👍

Comment on lines 68 to 75
private fun getDominantYearMonth(visibleDays: List<LocalDate>): YearMonth {
val yearMonthCount = visibleDays.groupingBy { YearMonth.from(it) }.eachCount()

return yearMonthCount.entries
.sortedByDescending { it.value }
.firstOrNull { it.value >= 4 }?.key
?: YearMonth.from(visibleDays.first())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private fun getDominantYearMonth(visibleDays: List<LocalDate>): YearMonth {
val yearMonthCount = visibleDays.groupingBy { YearMonth.from(it) }.eachCount()
return yearMonthCount.entries
.sortedByDescending { it.value }
.firstOrNull { it.value >= 4 }?.key
?: YearMonth.from(visibleDays.first())
}
private fun getMostFrequentYearMonth(visibleDays: List<LocalDate>): YearMonth {
return visibleDays
.groupingBy { YearMonth.from(it) }
.eachCount()
.maxBy { it.value }
.key
}

요거 단순하게 Grouping 한 후에 값이 가장 많은 YearMonth 로 넘겨주는건 어떨까요?

캘린더 상에서 과반이 항상 4일 이상을 의미하는건 아닐 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옹 넵 수정하고 머지하겠습니다!! 🙇

@SeonJeongk SeonJeongk merged commit c3ca0ff into develop Feb 8, 2025
1 check passed
@SeonJeongk SeonJeongk deleted the feature/TNT-180 branch February 8, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feat 기능 구현 🌻 선정 김씨 집안 막내 김선정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants