Calendars are used for date selection within a defined time period.


Maven Central Class reference Source code


Day Night
Labeled Calendar2 component Labeled Calendar2 component - dark mode


Day Night
Month Calendar2 component Month Calendar2 component - dark mode


Day Night
Range Calendar2 component Range Calendar2 component - dark mode


Backpack Android is available through Maven Central. Check the main Readme for a complete installation guide.

The calendar implementation relies on the Android adaptation of the JSR-310 backport for dealing with dates: ThreeTenABP

Add the following line in your base module's Gradle script:

                                                implementation 'com.jakewharton.threetenabp:threetenabp:$latestVersion'


NOTE: The docs for the previous version of Calendar is available here.

Be sure to initialize the ThreeTenABP library according to their usage guidelines in your Application's context:

                                                override fun onCreate() {

BpkCalendar uses coroutines under the hood. Since it designed with coroutines, the API is designed primarily for Kotlin language and may not be interoperable with Java. To use the API, make sure kotlinx-coroutines is included to your project.

BpkCalendar is designed as a state machine. All the information it contains is available as a state in the StateFlow. Each method of the public API and some of the user interactions will change its state and emit it.

The Calendar component can be used in both XML and Kotlin, but requires the basic setup to be done in Kotlin. Both single and range selection are supported.

Example of a calendar declaration in XML

NOTE: Note that the package name of new Calendar has been changed to net.skyscanner.backpack.calendar2.


Example of a declaration in Kotlin

                                                import net.skyscanner.backpack.calendar2.BpkCalendar

Once you've declared the calendar, you need to setup it like following:

                                                    range = LocalDate.of(2019, 1, 2)..LocalDate.of(2019, 12, 31), // start and end dates in the range
                                                    selectionMode = CalendarParams.SelectionMode.Single, // selection mode - can be Single, Dates, Months or Disabled

Now the component is ready. You can listen for the selection change using its state:

                                                  .map { it.selection }
                                                  .onEach { selection ->
                                                    when (selection) {
                                                      is CalendarSelection.None -> showToast("No date is selected")
                                                      is CalendarSelection.Single -> showToast("${} is selected")
                                                      is CalendarSelection.Dates -> showToast("${selection.start} to {${selection.end} is selected")
                                                      is CalendarSelection.Month -> showToast("${selection.month} is selected")

Advanced dates customisation

You can attach some of the information to each date displayed in calendar. This information will update its appearance and behaviour.

In order to do this, specify cellInfo parameters like shown here:

                                                    range = range,
                                                    selectionMode = selectionMode,
                                                    cellsInfo = mapOf(
                                                      LocalDate.of(2019, 1, 2) to CellInfo(
                                                        disabled = true, // marks date as disabled
                                                        status = CellStatus.Positive, // adds green colour to cell, you can use Neutral, Negative, Empty and null as well
                                                        label = "£30", // adds label below the date

Theme Props

  • calendarDateSelectedBackgroundColor
  • calendarDateSelectedRangeBackgroundColor
  • calendarDateSelectedTextColor
  • calendarDateSelectedSameDayBackgroundColor

Styles can be changed globally through bpkCalendarStyle. Check theming for more information.