Calendar

@Composable
fun Calendar(modifier: Modifier = Modifier, day: Int = 1, month: Int = 0, year: Int = DateTime.nowLocal().year, showDayNames: Boolean = true, showHeading: Boolean = true, showWeekNumber: Boolean = false, onDaySelect: (day: Int, month: Int, year: Int) -> Unit? = null, onNextMonth: () -> Unit? = null, onNextYear: () -> Unit? = null, onPreviousMonth: () -> Unit? = null, onPreviousYear: () -> Unit? = null)

Creates a org.gnome.gtk.Calendar to display a Gregorian calendar, one month at a time.

Parameters

modifier

Compose Modifier for layout and styling.

day

The selected day.

month

The selected month.

year

The selected year.

showDayNames

Whether the calendar shows day names.

showHeading

Whether the calendar should show a heading.

showWeekNumber

Whether week numbers are shown in the calendar.

onDaySelect

Callback triggered when a day is selected.

onNextMonth

Callback triggered when the calendar moves to the next month.

onNextYear

Callback triggered when the calendar moves to the next year.

onPreviousMonth

Callback triggered when the calendar moves to the previous month.

onPreviousYear

Callback triggered when the calendar moves to the previous year.


@Composable
fun Calendar(modifier: Modifier = Modifier, date: LocalDate = LocalDate(year = DateTime.nowLocal().year, month = Month.JANUARY, dayOfMonth = 1), showDayNames: Boolean = true, showHeading: Boolean = true, showWeekNumber: Boolean = false, onDaySelect: (date: LocalDate) -> Unit? = null, onNextMonth: () -> Unit? = null, onNextYear: () -> Unit? = null, onPreviousMonth: () -> Unit? = null, onPreviousYear: () -> Unit? = null)

Creates a org.gnome.gtk.Calendar to display a Gregorian calendar, one month at a time.

Parameters

modifier

Compose Modifier for layout and styling.

date

The selected date.

showDayNames

Whether the calendar shows day names.

showHeading

Whether the calendar should show a heading.

showWeekNumber

Whether week numbers are shown in the calendar.

onDaySelect

Callback triggered when a day is selected.

onNextMonth

Callback triggered when the calendar moves to the next month.

onNextYear

Callback triggered when the calendar moves to the next year.

onPreviousMonth

Callback triggered when the calendar moves to the previous month.

onPreviousYear

Callback triggered when the calendar moves to the previous year.