Skip to content

Commit

Permalink
🔗 :: (#684) 안내 상세 시간 파싱
Browse files Browse the repository at this point in the history
🔗 :: (#684) 안내 상세 시간 파싱
  • Loading branch information
parkuiery authored Jun 10, 2024
2 parents 9e9a124 + 12ed490 commit dd225c0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -125,3 +126,14 @@ internal fun NoticeDetailsScreen(
}
}
}

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,
)

2 changes: 2 additions & 0 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@

<string name="notice_new_notice_exists">새로운 공지사항이 있습니다</string>
<string name="notice_notices_not_exists">공지사항이 없습니다</string>

<string name="format_notice_time">%d/%d/%d %d:%d</string>

<!--my page-->
<string name="my_page_sign_out">로그아웃</string>
Expand Down

0 comments on commit dd225c0

Please sign in to comment.