From c4375f8cf3f06d1a320f3ed618ffdd9a0acf6b42 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Fri, 2 Feb 2024 17:59:32 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20DateFormatter=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EC=88=98=EC=A0=95=20(#208)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/common_ui/model/mapper/UiMapper.kt | 16 ++++++++-------- .../com/lgtm/domain/usecase/MissionUseCase.kt | 4 ++-- ...DateFormatter.kt => LgtmDateTimeFormatter.kt} | 4 ++-- .../src/main/res/layout/fragment_position.xml | 2 +- .../create_mission/CreateMissionStep5Fragment.kt | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) rename domain/src/main/java/com/lgtm/domain/util/{LgtmDateFormatter.kt => LgtmDateTimeFormatter.kt} (63%) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt index 50b0b6b0..89e053da 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt @@ -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, @@ -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, @@ -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 @@ -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) ?: "" ) } \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt b/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt index e36d81ca..17751acd 100644 --- a/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt +++ b/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt @@ -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 @@ -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 { diff --git a/domain/src/main/java/com/lgtm/domain/util/LgtmDateFormatter.kt b/domain/src/main/java/com/lgtm/domain/util/LgtmDateTimeFormatter.kt similarity index 63% rename from domain/src/main/java/com/lgtm/domain/util/LgtmDateFormatter.kt rename to domain/src/main/java/com/lgtm/domain/util/LgtmDateTimeFormatter.kt index 3a71602c..39230c90 100644 --- a/domain/src/main/java/com/lgtm/domain/util/LgtmDateFormatter.kt +++ b/domain/src/main/java/com/lgtm/domain/util/LgtmDateTimeFormatter.kt @@ -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")) \ No newline at end of file diff --git a/feature/auth/src/main/res/layout/fragment_position.xml b/feature/auth/src/main/res/layout/fragment_position.xml index 59f9932c..620b1557 100644 --- a/feature/auth/src/main/res/layout/fragment_position.xml +++ b/feature/auth/src/main/res/layout/fragment_position.xml @@ -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" />