diff --git a/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt b/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt index b6bee6d7..5f63d6dc 100644 --- a/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt +++ b/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt @@ -91,7 +91,12 @@ private fun CalendarScreen( snapshotFlow { pagerState.currentPage } .collect { current -> val date = getLocalDateByPage(current) - val newDate = LocalDate.of(date.year, date.month, uiState.selectedDate.dayOfMonth) + + val newDate = LocalDate.of( + date.year, + date.month, + uiState.selectedDate.dayOfMonth.coerceAtMost(date.month.minLength()) + ) updateSelectedDate(newDate) } }