-
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
[TNT-181] 트레이니 홈 화면 일별 기록 UI 구현 #71
Conversation
) | ||
} | ||
} | ||
if (state.recordList.isNullOrEmpty()) { |
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.
null
과 empty
가 같은 의미인지 한 번 더 생각해보면 좋을 것 같습니다 ~!
val markedDates: List<LocalDate> = emptyList(), | ||
val recordList: List<RecordList> = emptyList(), | ||
val selectedDay: LocalDate = LocalDate.now(), | ||
val dailyDataState: List<LocalDate> = emptyList(), |
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.
selectedDay
는 현재 달력에서 선택된 날짜이고,
dailyDataState
는 달력에 PT 수업 혹은 기록이 있으면 icon을 표시하기 위해 해당하는 날짜들을 담고있습니다..!
// 시간을 "오후 14:00"의 형식으로 바꿔준다 | ||
@Composable | ||
private fun formatTime(isoString: String): String { | ||
val timePart = isoString.substringAfter('T').substring(0, 5) | ||
val hour = timePart.substring(0, 2).toInt() | ||
|
||
val amPm = if (hour < 12) { | ||
stringResource(uiResource.string.morning) | ||
} else { | ||
stringResource(uiResource.string.afternoon) | ||
} | ||
|
||
return "$amPm $timePart" | ||
} | ||
|
||
// 선택된 날짜를 "0월 0일 0요일"의 형식으로 바꿔준다 | ||
private fun formatDateWithDay(date: LocalDate): String { | ||
val monthDayFormatter = DateTimeFormatter.ofPattern("M월 d일", Locale.KOREAN) | ||
val monthDay = date.format(monthDayFormatter) | ||
|
||
val dayOfWeek = date.dayOfWeek.getDisplayName(TextStyle.FULL, Locale.KOREAN) | ||
|
||
return "$monthDay $dayOfWeek" | ||
} |
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.
지금도 DateFormatter
를 사용할 수 있을 것처럼 보이는데, 혹시 API 연결 후에 사용해야 하는 이유가 있을까용 ?.?
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.
TNT-179
branch 머지되면 해당 코드 기반으로 구현하려고 했습니다!!
언제 머지될지 모르겠어서 일단 뒤로 미뤘습니다..ㅎ
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.
그렇담 수정해오겠습니다 🏃
- 데이터 클래스 이름 변경 및 Response 데이터 클래스 추가 - Response 데이터를 도메인 모델로 변환 - dateFormatter를 활용해 날짜 및 시간 변환 처리
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.
고생하셨습니당 ~~~~!!! 👍👍👍
📝 작업 내용
[TNT-181] 트레이니의 일별 기록 출력 #44
트레이니 홈 화면 일별 기록 UI 구현했습니다
API 연결하면서 DateFormatter로 시간 변환하겠습니다.
📸 실행 화면
TraineeHomeDaily.mp4
🙆🏻 리뷰 요청 사항
없습니다아
👀 레퍼런스