Skip to content

Commit

Permalink
[CHORE] DateFormatter 네이밍 수정 (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
KxxHyoRim committed Feb 2, 2024
1 parent 26a9e7c commit c4375f8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ import com.lgtm.domain.entity.response.PingPongSeniorVO
import com.lgtm.domain.entity.response.ProfileVO
import com.lgtm.domain.mission_suggestion.SuggestionVO
import com.lgtm.domain.profile.profileViewType.ProfileGlance
import com.lgtm.domain.util.dotStyleFormatter
import com.lgtm.domain.util.timeFormatter
import com.lgtm.domain.util.dotStyleDateFormatter
import com.lgtm.domain.util.korean12HourTimeFormatter
import java.time.LocalDateTime

fun MissionDetailVO.toUiModel(): MissionDetailUI = MissionDetailUI(
currentPeopleNumber = currentPeopleNumber,
description = description,
maxPeopleNumber = maxPeopleNumber,
memberProfile = memberProfile.toUiModel(memberType),
memberProfile = memberProfile.toUiModel(),
memberType = memberType,
missionId = missionId,
missionRepositoryUrl = missionRepositoryUrl,
Expand All @@ -55,7 +55,7 @@ fun MissionDetailVO.toUiModel(): MissionDetailUI = MissionDetailUI(
missionDetailButtonStatusUI = getButtonStatusUI(missionDetailStatus)
)

fun ProfileVO.toUiModel(role: Role): ProfileGlanceUI = ProfileGlanceUI(
fun ProfileVO.toUiModel(): ProfileGlanceUI = ProfileGlanceUI(
memberId = memberId,
profileImage = profileImageUrl,
nickname = nickname,
Expand Down Expand Up @@ -223,8 +223,8 @@ fun SuggestionVO.toUiModel(): SuggestionUI {
title = title,
description = description,
suggestionId = suggestionId,
date = localDateTime.format(dotStyleFormatter),
time = localDateTime.format(timeFormatter),
date = localDateTime.format(dotStyleDateFormatter),
time = localDateTime.format(korean12HourTimeFormatter),
likeNum = likeNum,
isLiked = isLiked,
isMyPost = isMyPost
Expand All @@ -237,7 +237,7 @@ fun NotificationVO.toUiModel(): NotificationUI {
body = body,
notificationId = notificationId,
isRead = isRead,
time = date?.format(timeFormatter) ?: "",
date = date?.format(dotStyleFormatter) ?: ""
time = date?.format(korean12HourTimeFormatter) ?: "",
date = date?.format(dotStyleDateFormatter) ?: ""
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.lgtm.domain.server_drive_ui.SduiContent
import com.lgtm.domain.server_drive_ui.SduiEmptyUiState
import com.lgtm.domain.server_drive_ui.SduiViewType
import com.lgtm.domain.server_drive_ui.SectionEmptyVO
import com.lgtm.domain.util.dotStyleFormatter
import com.lgtm.domain.util.dotStyleDateFormatter
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import org.jsoup.Jsoup
Expand Down Expand Up @@ -137,7 +137,7 @@ class MissionUseCase @Inject constructor(
private fun convertTimestampToCustomFormat(timestamp: String?): String {
if (timestamp == null || timestamp == "") return "-"
val localDateTime = LocalDateTime.parse(timestamp)
return localDateTime.format(dotStyleFormatter)
return localDateTime.format(dotStyleDateFormatter)
}

suspend fun confirmJuniorPayment(missionID: Int): Result<Boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.lgtm.domain.util
import java.time.format.DateTimeFormatter
import java.util.Locale

val dotStyleFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy.MM.dd")
val dotStyleDateFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy.MM.dd")
val isoStyleFormatter: DateTimeFormatter = DateTimeFormatter.ISO_DATE
val timeFormatter: DateTimeFormatter =
val korean12HourTimeFormatter: DateTimeFormatter =
DateTimeFormatter.ofPattern("a h:mm").withLocale(Locale("ko", "KR"))
2 changes: 1 addition & 1 deletion feature/auth/src/main/res/layout/fragment_position.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="53dp"
app:layout_constraintTop_toBottomOf="@id/tv_enter_position" />
app:layout_constraintTop_toBottomOf="@id/tv_position_example" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_next"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.lgtm.android.common_ui.base.BaseFragment
import com.lgtm.android.common_ui.util.NetworkState
import com.lgtm.android.common_ui.util.setOnThrottleClickListener
import com.lgtm.android.create_mission.databinding.FragmentCreateMissionStep5Binding
import com.lgtm.domain.util.dotStyleFormatter
import com.lgtm.domain.util.dotStyleDateFormatter
import dagger.hilt.android.AndroidEntryPoint
import java.time.LocalDate
import java.util.Calendar
Expand Down Expand Up @@ -46,7 +46,7 @@ class CreateMissionStep5Fragment :
}

private fun setFormattedDate(localDate: LocalDate) {
val formattedDate = localDate.format(dotStyleFormatter)
val formattedDate = localDate.format(dotStyleDateFormatter)
binding.etRegistrationDueDate.setText(formattedDate)
}

Expand Down

0 comments on commit c4375f8

Please sign in to comment.