Home

Awesome

Calendar

A highly customizable calendar library for Android and Compose Multiplatform, backed by RecyclerView for the view system, and LazyRow/LazyColumn for compose.

Check License Twitter Android Library Multiplatform Library

With this library, your calendar will look however you want it to.

Preview

Features

Sample project

It's important to check out the sample app. There are lots of examples provided for both view and compose implementations. Most techniques that you would want to implement are already done in the examples.

Download the Android sample app here

View the Android sample app's source code here

View the multiplatform sample project online at https://calendar.kizitonwose.dev

View the multiplatform sample project's source code here

Setup

The library provides two compose artifacts: com.kizitonwose.calendar:compose which uses the java.time APIs for pure Android projects and com.kizitonwose.calendar:compose-multiplatform which uses the kotlinx-datetime library for Compose Multiplatform projects. The multiplatform library supports Android, iOS, WasmJs and Desktop platforms.

The Android view library artifact com.kizitonwose.calendar:view also uses the java.time APIs and can exist alongside the Android compose artifact in an Android project if needed.

Step 1

This step is required ONLY if your Android app's minSdkVersion is below 26. Jump to step 2 if this does not apply to you.

Android apps with minSdkVersion below 26 have to enable Java 8+ API desugaring for backward compatibility since java.time classes were added in Java 8 which is supported natively starting from Android SDK 26. To set up your project for desugaring, you need to first ensure that you are using Android Gradle plugin 4.0.0 or higher.

Then include the following in your app's build.gradle file:

android {
  defaultConfig {
    // Required ONLY if your minSdkVersion is below 21
    multiDexEnabled true
  }

  compileOptions {
    // Enable support for the new language APIs
    coreLibraryDesugaringEnabled true
    // Set Java compatibility (version can be higher if desired)
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  kotlinOptions {
    // Also add this for Kotlin projects (version can be higher if desired)
    jvmTarget = "1.8"
  }
}

dependencies {
  coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:<latest-version>'
}

You can find the latest version of desugar_jdk_libs here.

Step 2A - For pure Android projects without multiplatform setup

Add the desired calendar library (view or compose) to your app's build.gradle.kts:

dependencies {
  // The view calendar library for Android
  implementation("com.kizitonwose.calendar:view:<latest-version>")

  // The compose calendar library for Android
  implementation("com.kizitonwose.calendar:compose:<latest-version>")
}

Step 2B - For Compose Multiplatform projects

Add the multiplatform calendar library to your project's build.gradle.kts:

commonMain.dependencies {
  // The calendar library for compose multiplatform projects
  // Supports Android, iOS, WasmJs and Desktop platforms
  implementation("com.kizitonwose.calendar:compose-multiplatform:<latest-version>")
}

You can find the latest version of the library on the maven central badge above.

Snapshots of the development version are available in Sonatype’s snapshots repository.

Compose UI version compatibility

For the compose calendar library, ensure that you are using the library version that matches the Compose UI version in your project. If you use a version of the library that has a higher version of Compose UI than the one in your project, gradle will upgrade the Compose UI version in your project via transitive dependency.

Compose UIAndroid Calendar LibraryMultiplatform Calendar Library
1.2.x2.0.x-
1.3.x2.1.x - 2.2.x-
1.4.x2.3.x-
1.5.x2.4.x-
1.6.x2.5.x2.5.x
1.7.x2.6.x2.6.x

Usage

You can find the relevant documentation for the library in the links below.

View-based documentationCompose documentation

Migration

If you're upgrading from calendar library version 1.x.x to 2.x.x, see the migration guide.

Share your creations

Made a cool calendar with this library? Share an image here.

Contributing

Found a bug? feel free to fix it and send a pull request or open an issue.

License

Calendar library is distributed under the MIT license. See LICENSE for details.