Voltar ao ranking

kizitonwose/Calendar

Kotlin

A highly customizable calendar view and compose library for Android and Kotlin Multiplatform.

calendarcalendarviewdatedatepickercomposecompose-calendarandroidheatmap-calendarmonth-calendarweek-calendardate-range-pickerdate-range
Crescimento de estrelas
Estrelas
5.6k
Forks
578
Crescimento semanal
Issues
9
2k4k
jun. de 2019out. de 2021mar. de 2024jul. de 2026
README

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 Phone

Preview Web Tablet

Features

  • Week, month, or year modes - Show a week-based calendar, or the typical month calendar, or a year-based calendar.
  • Single, multiple, or range selection - Total flexibility to implement the date selection whichever way you like.
  • Disable desired dates - Prevent selection of some dates by disabling them.
  • Boundary dates - Limit the calendar date range.
  • Custom date view/composable - Make your day cells look however you want, with any functionality you want.
  • Custom calendar view/composable - Make your calendar look however you want, with whatever functionality you want.
  • Custom first day of the week - Use any day as the first day of the week.
  • Horizontal or vertical scrolling calendar.
  • HeatMap calendar - Suitable for showing how data changes over time, like GitHub's contribution chart.
  • Year/Month/Week headers and footers - Add headers/footers of any kind on each year/month/week.
  • Easily scroll to any date/week/month/year on the calendar via swipe actions or programmatically.
  • Use all RecyclerView/LazyRow/LazyColumn customizations since the calendar extends from RecyclerView for the view system and uses LazyRow/LazyColumn for compose.
  • Design your calendar however you want. The library provides the logic, you provide the views/composables.

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 the following artifacts:

com.kizitonwose.calendar:compose: The compose artifact for Android projects. This uses the java.time APIs.

com.kizitonwose.calendar:compose-multiplatform: The compose artifact for Compose Multiplatform projects. This uses the kotlinx-datetime library and supports Android, iOS, js, WasmJs and Desktop platforms.

com.kizitonwose.calendar:view: The view artifact for Android projects. This 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, js, 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 Central Portal 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 UI Android Calendar Library Multiplatform Calendar Library
1.2.x 2.0.x -
1.3.x 2.1.x - 2.2.x -
1.4.x 2.3.x -
1.5.x 2.4.x -
1.6.x 2.5.x 2.5.x
1.7.x 2.6.x 2.6.x
1.8.x 2.7.x - 2.8.x 2.7.x - 2.8.x
1.9.x 2.9.x 2.9.x
1.10.x 2.10.x 2.10.x

Usage

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

View-based documentation Compose 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.

Repositórios relacionados
fullcalendar/fullcalendar

Full-sized drag & drop event calendar in JavaScript

TypeScriptnpmMIT Licensecalendarevent
fullcalendar.io
20.6k3.7k
nhn/tui.calendar

🍞📅A JavaScript calendar that has everything you need.

TypeScriptnpmMIT Licensecalendarfullcalendar
ui.toast.com/tui-calendar
12.7k1.4k
react-dates/react-dates

An easily internationalizable, mobile-friendly datepicker library for the web

JavaScriptnpmMIT Licensereactdatepicker
react-dates.github.io/react-dates/
12.2k1.7k
Leantime/leantime

Leantime is a goals focused project management system for non-project managers. Building with ADHD, Autism, and dyslexia in mind.

PHPPackagistGNU Affero General Public License v3.0project-managementphp
leantime.io
11k1.1k
WenchaoD/FSCalendar

A fully customizable iOS calendar library, compatible with Objective-C and Swift

Objective-CMIT Licenseswiftobjective-c
10.6k1.9k
wix/react-native-calendars

React Native Calendar Components 🗓️ 📆

TypeScriptnpmMIT Licensereact-nativeandroid
10.3k3.1k
huanghaibin-dev/CalendarView

RecyclerView? ListView or ViewGroup? No, it's Canvas! Ultra performance and free customization interface! Vertical and horizontal, Fast rendering and extremely low memory. Android上一个优雅、万能自定义UI、仿iOS、自定义动画,支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,热插拔实现UI定制!Canvas绘制,渲染速度快、占用内存低,你真的想不到日历居然还可以如此优雅。

JavaMavenApache License 2.0calendarviewcalendar-component
9.4k1.8k
amsul/pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.

JavaScriptnpmMIT Licensepickerdate
amsul.ca/pickadate.js
7.7k984
patchthecode/JTAppleCalendar

The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable

SwiftMIT Licensecalendarswift
patchthecode.com
7.7k800
gpbl/react-day-picker

DayPicker is a customizable date picker component for React. Add date pickers, calendars, and date inputs to your web applications.

TypeScriptnpmMIT Licensereactdatepicker
daypicker.dev
6.8k773
IonicaBizau/git-stats

🍀 Local git statistics including GitHub-like contributions calendars.

HTMLMIT Licensecontributions-calendargitstats
6.6k189
prolificinteractive/material-calendarview

A Material design back port of Android's CalendarView

JavaMavenMIT Licensejavamaterial
prolificinteractive.github.io/material-calendarview/
5.9k1.3k