-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from team-haribo/feature/290-change-the-date-…
…to-appear-on-the-late-list 🔀 :: (#290) - change the date to appear on the late list
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
core/design-system/src/main/java/com/goms/design_system/util/formatDate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.goms.design_system.util | ||
|
||
import kotlinx.datetime.LocalDate | ||
import java.time.format.TextStyle | ||
import java.util.Locale | ||
|
||
fun LocalDate.formatDate(): String { | ||
val year = this.year | ||
val month = this.monthNumber | ||
val day = this.dayOfMonth | ||
|
||
val dayOfWeek = this.dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN) | ||
|
||
return "${year}년 ${month}월 ${day}일 ($dayOfWeek)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
feature/main/src/main/java/com/goms/main/component/LocalDateText.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.goms.main.component | ||
|
||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.text.font.FontWeight | ||
import com.goms.design_system.theme.GomsTheme.colors | ||
import com.goms.design_system.theme.GomsTheme.typography | ||
import com.goms.design_system.util.formatDate | ||
import kotlinx.datetime.LocalDate | ||
|
||
@Composable | ||
internal fun LocalDateText(date: LocalDate) { | ||
Text( | ||
text = date.formatDate(), | ||
style = typography.textSmall, | ||
fontWeight = FontWeight.SemiBold, | ||
color = colors.WHITE | ||
) | ||
} |