Skip to content

Commit

Permalink
[CHORE] #125 : 일정 등록 마감 시간 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 16, 2024
1 parent 2b2d8ce commit 12f3cb1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ internal fun EventRegistrationScreen(
EventRegistrationContent(
eventRegistrationState = currentRegistrationState,
modifier = Modifier
.padding(
top = 50.dp,
start = 20.dp,
end = 20.dp,
bottom = 20.dp,
),
.padding(top = 50.dp, start = 20.dp, end = 20.dp, bottom = 20.dp),
eventTitle = title,
eventContent = content,
location = location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ class EventRegistrationViewModel @Inject constructor(
MutableStateFlow(generateNowTime().plusHours(1))
val eventEndTime = _eventEndTime.asStateFlow()

fun setEventTitle(eventTitle: String) { _eventTitle.value = eventTitle }
fun setEventTitle(eventTitle: String) {
_eventTitle.value = eventTitle
}

fun setEventContent(eventContent: String) { _eventContent.value = eventContent }
fun setEventContent(eventContent: String) {
_eventContent.value = eventContent
}

fun setEventLocation(eventLocation: String) { _eventLocation.value = eventLocation }
fun setEventLocation(eventLocation: String) {
_eventLocation.value = eventLocation
}

fun setEventStartDate(eventDate: LocalDate) {
if (!isValidStartDate(eventDate)) {
Expand All @@ -68,7 +74,9 @@ class EventRegistrationViewModel @Inject constructor(
_eventStartDate.value = eventDate
}

fun setEventStartTime(eventTime: LocalTime) { _eventStartTime.value = eventTime }
fun setEventStartTime(eventTime: LocalTime) {
_eventStartTime.value = eventTime
}

fun setEventEndDate(eventDate: LocalDate) {
if (!isValidEndDate(eventDate)) {
Expand Down Expand Up @@ -122,8 +130,15 @@ class EventRegistrationViewModel @Inject constructor(
}
}

private fun isValidEndTime(eventTime: LocalTime): Boolean =
_eventEndDate.value == _eventStartDate.value && eventTime > _eventStartTime.value
private fun isValidEndTime(eventTime: LocalTime): Boolean {
if (_eventEndDate.value > _eventStartDate.value) {
return true
}
if (_eventEndDate.value == _eventStartDate.value && eventTime > _eventStartTime.value) {
return true
}
return false
}

private fun isValidEndDate(eventDate: LocalDate): Boolean = eventDate >= _eventStartDate.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal fun SurveyCheckScreen(
verticalArrangement = Arrangement.spacedBy(20.dp),
modifier = Modifier
.fillMaxSize()
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp, top = 40.dp)
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp, top = 20.dp)
.padding(paddingValues),
) {
val surveyList = surveyListUiState.surveyList
Expand Down

0 comments on commit 12f3cb1

Please sign in to comment.