Package-level declarations

Dates: JengaDatePicker (optionally limited to a dateRange, with a year grid behind the title), JengaDatePickerDialog, and JengaCalendar, a paging month grid whose day cells are your own content.

Types

Link copied to clipboard
class JengaCalendarColors(val selectedContainer: Color, val selectedContent: Color, val todayBorder: Color, val content: Color, val disabledContent: Color, val weekdayContent: Color, val titleContent: Color)

Resolved colors for calendar day cells and the date picker. Override via JengaCalendarDefaults.colors.

Link copied to clipboard
class JengaCalendarDay(val date: LocalDate, val position: JengaCalendarDayPosition)

One cell of a JengaCalendar: a date and where it falls relative to the shown month.

Link copied to clipboard

Where a JengaCalendarDay falls relative to the month being shown.

Link copied to clipboard

Defaults, token mappings and reusable cells for JengaCalendar and JengaDatePicker.

Link copied to clipboard

The scroll state of a JengaCalendar: which months it can show and which one is visible. Create one with rememberJengaCalendarState.

Functions

Link copied to clipboard
fun JengaCalendar(state: JengaCalendarState, modifier: Modifier = Modifier, monthHeader: @Composable (YearMonth) -> Unit = {}, weekHeader: @Composable (List<DayOfWeek>) -> Unit = {}, dayContent: @Composable BoxScope.(JengaCalendarDay) -> Unit)

A month calendar that pages horizontally between the months of state. Every part is a slot: dayContent draws each cell of the six-week grid, including the days of the neighbouring months (check JengaCalendarDay.position), and monthHeader and weekHeader sit above each month's grid. Selection and styling are the caller's; JengaDatePicker is a ready-made single-date picker built on it, and JengaCalendarDefaults.Day is a cell you can reuse.

Link copied to clipboard
fun JengaDatePicker(selectedDate: LocalDate?, onSelectedDateChange: (LocalDate) -> Unit, monthTitle: (YearMonth) -> String, dayOfWeekLabel: (DayOfWeek) -> String, previousMonthContentDescription: String, nextMonthContentDescription: String, modifier: Modifier = Modifier, dateRange: ClosedRange<LocalDate>? = null, state: JengaCalendarState = rememberDefaultPickerState(selectedDate, dateRange), isSelectable: (LocalDate) -> Boolean = { true }, today: LocalDate = remember { JengaCalendarDefaults.today() }, dateContentDescription: (LocalDate) -> String = { it.toString() }, colors: JengaCalendarColors = JengaCalendarDefaults.colors(), yearPickerLabel: (YearMonth) -> String? = null)

A single-date picker: a month title with previous/next buttons above a paging JengaCalendar. Every visible string comes from the caller (monthTitle, dayOfWeekLabel and the button descriptions), so it follows the app's locale.

Link copied to clipboard
fun JengaDatePickerDialog(onDismissRequest: () -> Unit, onConfirm: (LocalDate) -> Unit, confirmLabel: String, dismissLabel: String, monthTitle: (YearMonth) -> String, dayOfWeekLabel: (DayOfWeek) -> String, previousMonthContentDescription: String, nextMonthContentDescription: String, modifier: Modifier = Modifier, initialSelectedDate: LocalDate? = null, isSelectable: (LocalDate) -> Boolean = { true }, dateContentDescription: (LocalDate) -> String = { it.toString() }, colors: JengaCalendarColors = JengaCalendarDefaults.colors(), dateRange: ClosedRange<LocalDate>? = null, yearPickerLabel: (YearMonth) -> String? = null)

A modal dialog holding a JengaDatePicker with confirm and dismiss actions. The confirm action is enabled once a date is picked.

Link copied to clipboard
fun rememberJengaCalendarState(startMonth: YearMonth, endMonth: YearMonth, firstVisibleMonth: YearMonth = startMonth, firstDayOfWeek: DayOfWeek = DayOfWeek.MONDAY): JengaCalendarState

Remembers a JengaCalendarState.