
commonMain.io.wojciechosak.calendar.view.MonthHeader.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of calendar-jvm Show documentation
Show all versions of calendar-jvm Show documentation
Kotlin Compose Multiplatform UI library that simplifies usage of calendar views
package io.wojciechosak.calendar.view
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import kotlinx.datetime.Month
@Composable
fun MonthHeader(month: Month, year: Int) {
val months = listOf(
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
)
Text(
"${months.getOrNull(month.ordinal)} $year",
modifier = Modifier.fillMaxWidth().padding(bottom = 20.dp, top = 0.dp),
textAlign = TextAlign.Center,
fontWeight = FontWeight.ExtraLight,
fontSize = 16.sp,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy