From fd48833146ffbacea7d74d284cd970195eb00684 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 4 Jun 2024 21:01:36 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=ED=8C=8C=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dms/android/feature/notice/NoticeDetailsScreen.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt index efd483064..8af053fd4 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt @@ -23,6 +23,7 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import org.threeten.bp.LocalDateTime import team.aliens.dms.android.core.designsystem.Scaffold import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.DmsTopAppBar @@ -88,7 +89,7 @@ internal fun NoticeDetailsScreen( modifier = Modifier .fillMaxWidth() .horizontalPadding(), - text = uiState.createdAt.toString(), + text = uiState.createdAt.text, style = DmsTheme.typography.caption, color = DmsTheme.colorScheme.onSurfaceVariant, ) @@ -125,3 +126,7 @@ internal fun NoticeDetailsScreen( } } } + +private val LocalDateTime?.text: String + @Composable inline get() = "${this?.year}-${this?.monthValue}-${this?.dayOfMonth} ${this?.hour}:${this?.minute}" + From 12ed49095f9de48d07d55608d2ba7a3c39e65354 Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 8 Jun 2024 17:52:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20string=20resource?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/announcement/AnnouncementListScreen.kt | 9 ++++++++- .../android/feature/notice/NoticeDetailsScreen.kt | 13 ++++++++++--- feature/src/main/res/values/strings.xml | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt index c3d97aa95..ca1d4eaea 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt @@ -181,4 +181,11 @@ private fun NoticeCard( } private val LocalDateTime.text: String - @Composable inline get() = "${this.year}-${this.monthValue}-${this.dayOfMonth} ${this.hour}:${this.minute}" + @Composable inline get() = stringResource( + id = R.string.format_notice_time, + this.year, + this.monthValue, + this.dayOfMonth, + this.hour, + this.minute, + ) diff --git a/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt index 8af053fd4..05541a3d1 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/notice/NoticeDetailsScreen.kt @@ -89,7 +89,7 @@ internal fun NoticeDetailsScreen( modifier = Modifier .fillMaxWidth() .horizontalPadding(), - text = uiState.createdAt.text, + text = uiState.createdAt!!.text, style = DmsTheme.typography.caption, color = DmsTheme.colorScheme.onSurfaceVariant, ) @@ -127,6 +127,13 @@ internal fun NoticeDetailsScreen( } } -private val LocalDateTime?.text: String - @Composable inline get() = "${this?.year}-${this?.monthValue}-${this?.dayOfMonth} ${this?.hour}:${this?.minute}" +private val LocalDateTime.text: String + @Composable inline get() = stringResource( + id = R.string.format_notice_time, + this.year, + this.monthValue, + this.dayOfMonth, + this.hour, + this.minute, + ) diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 52108e59c..c3b6a9ad7 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -201,6 +201,8 @@ 새로운 공지사항이 있습니다 공지사항이 없습니다 + + %d/%d/%d %d:%d 로그아웃