Skip to content

Commit

Permalink
Merge pull request #6 from DogusTeknoloji/feature/month_numbers_format
Browse files Browse the repository at this point in the history
Change month numbers format as 01,02,03 .....
  • Loading branch information
BerkkanB authored Feb 23, 2022
2 parents 93bb5a7 + 16a11b0 commit 6959dd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ fun MonthItem(
minMonth = minMonth,
numberOfElement = numberOfElement
)

val monthAsNumber = String.format("%02d",numberOfElement.plus(1))

val monthText: String = when (monthViewType) {
MonthViewType.ONLY_MONTH -> month.name.uppercase()
MonthViewType.ONLY_NUMBER -> numberOfElement.plus(1).toString()
MonthViewType.ONLY_NUMBER -> monthAsNumber
MonthViewType.BOTH_NUMBER_AND_MONTH -> month.name.uppercase() + " " + "(${
numberOfElement.plus(
1
)
monthAsNumber
})"
else -> month.name.uppercase()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ fun MonthItemOneColumn(
numberOfElement = index
)

val monthAsNumber = String.format("%02d",index.plus(1))

Box(modifier = Modifier
.padding(vertical = 6.dp)
.clickable(
Expand All @@ -95,7 +97,7 @@ fun MonthItemOneColumn(
}
}) {
Text(
text = index.plus(1).toString(),
text = monthAsNumber,
fontSize = if (month.name == selectedMonth) 35.sp else 30.sp,
color = if (enabled && month.name == selectedMonth) themeColor
else if (enabled) Color.Black
Expand Down

0 comments on commit 6959dd1

Please sign in to comment.