
Offers a datetime picker library for creating date and date range selectors with customizable defaults, built using Compose Multiplatform. Future enhancements include time selection features.
This is a Kotlin Multiplatform library that provides a datetimepicker for Android and iOS. It is based on the kotlinx-datetime library. The library is written in Compose Multiplatform. I have created this library because I needed a datetimepicker for my Kotlin Multiplatform project and I could not find any library that would suit my needs. The library is still in development and I will be adding more features in the future. If you have any suggestions or you have found a bug, please let me know. I will be happy to help you.
Add the following to your build.gradle.kts file:
repositories {
mavenCentral()
}Add the following to your common source set dependencies:
implementation("cz.kudladev:datetimepicker-kmp:<latest_version>")DatePicker(
modifier: Modifier = Modifier,
range: Boolean = false,
onSelectDate: (LocalDate) -> Unit = {},
onRangeSelected: (LocalDate, LocalDate) -> Unit = { _, _ -> },
dateTimePickerDefaults: DateTimePickerDefaults = DateTimePickerDefaults(),
dateTimePickerColors: DateTimePickerColors = DateTimePickerColors()
)Where DateTimePickerDefaults is a class that contains the following properties:
data class DateTimePickerDefaults(
val monthNames: MonthNames = MonthNames.ENGLISH_FULL,
val dayOfWeekNames: DayOfWeekNames = DayOfWeekNames.ENGLISH_FULL,
val timeZone: TimeZone = TimeZone.currentSystemDefault(),
var disabledDates: List<String> = emptyList(),
var dayOfWeekNamesShort: DayOfWeekNames = DayOfWeekNames.ENGLISH_ABBREVIATED, // They are calculated from dayOfWeekNames
var disablePastDates: Boolean = false,
val formater: DateTimeFormat<LocalDate> = LocalDate.Format {
dayOfWeek(DayOfWeekNames.ENGLISH_ABBREVIATED)
chars(", ")
date(LocalDate.Format {
monthName(MonthNames.ENGLISH_FULL)
chars(" ")
dayOfMonth()
})
}
)If you want to edit the defaults, You need to add the kotlinx-datetime dependency.
This project is licensed under the MIT License - see the LICENSE file for details.
This is a Kotlin Multiplatform library that provides a datetimepicker for Android and iOS. It is based on the kotlinx-datetime library. The library is written in Compose Multiplatform. I have created this library because I needed a datetimepicker for my Kotlin Multiplatform project and I could not find any library that would suit my needs. The library is still in development and I will be adding more features in the future. If you have any suggestions or you have found a bug, please let me know. I will be happy to help you.
Add the following to your build.gradle.kts file:
repositories {
mavenCentral()
}Add the following to your common source set dependencies:
implementation("cz.kudladev:datetimepicker-kmp:<latest_version>")DatePicker(
modifier: Modifier = Modifier,
range: Boolean = false,
onSelectDate: (LocalDate) -> Unit = {},
onRangeSelected: (LocalDate, LocalDate) -> Unit = { _, _ -> },
dateTimePickerDefaults: DateTimePickerDefaults = DateTimePickerDefaults(),
dateTimePickerColors: DateTimePickerColors = DateTimePickerColors()
)Where DateTimePickerDefaults is a class that contains the following properties:
data class DateTimePickerDefaults(
val monthNames: MonthNames = MonthNames.ENGLISH_FULL,
val dayOfWeekNames: DayOfWeekNames = DayOfWeekNames.ENGLISH_FULL,
val timeZone: TimeZone = TimeZone.currentSystemDefault(),
var disabledDates: List<String> = emptyList(),
var dayOfWeekNamesShort: DayOfWeekNames = DayOfWeekNames.ENGLISH_ABBREVIATED, // They are calculated from dayOfWeekNames
var disablePastDates: Boolean = false,
val formater: DateTimeFormat<LocalDate> = LocalDate.Format {
dayOfWeek(DayOfWeekNames.ENGLISH_ABBREVIATED)
chars(", ")
date(LocalDate.Format {
monthName(MonthNames.ENGLISH_FULL)
chars(" ")
dayOfMonth()
})
}
)If you want to edit the defaults, You need to add the kotlinx-datetime dependency.
This project is licensed under the MIT License - see the LICENSE file for details.