{"id":22378205,"url":"https://github.com/aminography/primedatepicker","last_synced_at":"2025-04-04T10:08:52.921Z","repository":{"id":41243395,"uuid":"188271012","full_name":"aminography/PrimeDatePicker","owner":"aminography","description":"PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days.","archived":false,"fork":false,"pushed_at":"2024-07-26T10:04:06.000Z","size":10322,"stargazers_count":473,"open_issues_count":27,"forks_count":53,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T09:07:15.100Z","etag":null,"topics":["calendar","calendar-component","calendar-view","calendarview","datepicker","datepicker-range","gregorian-calendar","hijri-calendar","japanese-calendar","material","material-design","monthview","persian-calendar","picker-bottom-sheet"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminography.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T16:34:01.000Z","updated_at":"2025-01-31T10:38:47.000Z","dependencies_parsed_at":"2024-12-28T14:02:39.436Z","dependency_job_id":"c04aebc5-edc4-4f66-ac9d-811a08b74b02","html_url":"https://github.com/aminography/PrimeDatePicker","commit_stats":{"total_commits":588,"total_committers":3,"mean_commits":196.0,"dds":0.3945578231292517,"last_synced_commit":"9ad06c7010963b25943121ef97eab7463db3cdfa"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminography%2FPrimeDatePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminography%2FPrimeDatePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminography%2FPrimeDatePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminography%2FPrimeDatePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminography","download_url":"https://codeload.github.com/aminography/PrimeDatePicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","calendar-component","calendar-view","calendarview","datepicker","datepicker-range","gregorian-calendar","hijri-calendar","japanese-calendar","material","material-design","monthview","persian-calendar","picker-bottom-sheet"],"created_at":"2024-12-04T22:18:04.660Z","updated_at":"2025-04-04T10:08:52.898Z","avatar_url":"https://github.com/aminography.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `PrimeDatePicker` :zap:\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PrimeDatePicker-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/7743)\n[![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23367-red.svg)](http://androidweekly.net/issues/issue-367)\n![mavenCentral](https://img.shields.io/maven-central/v/com.aminography/primedatepicker?color=blue)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c1c44ee8a3a14b0e8c963c36c8e586d8)](https://app.codacy.com/manual/aminography/PrimeDatePicker?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=aminography/PrimeDatePicker\u0026utm_campaign=Badge_Grade_Dashboard)\n[![API](https://img.shields.io/badge/minSdkVersion-13-important.svg)](https://android-arsenal.com/api?level=13)\n\nFirstly, **`PrimeDatePicker`** is a tool that provides picking a single day, multiple days, and a range of days. Secondly, you can use internal elements like `MonthView` and `CalendarView` as stand-alone views in your projects.\n![](static/prime_logo.png)\n\n\u003ctable\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eMultiple Days | Civil\u003c/b\u003e\u003cbr/\u003e\u003ci\u003eBottomSheet | Dark\u003c/i\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eRange of Days | Persian\u003c/b\u003e\u003cbr/\u003e\u003ci\u003eBottomSheet | Light\u003c/i\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eSingle Day | Hijri\u003c/b\u003e\u003cbr/\u003e\u003ci\u003eDialog | Light\u003c/i\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eGoto Feature | Japanese\u003c/b\u003e\u003cbr/\u003e\u003ci\u003eDialog | Dark\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"static/MCDB.gif\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"static/RPLB.gif\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"static/SHLD.gif\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"static/GJDD2.gif\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cbr/\u003e\n\nTable of Contents\n-----------------\n\n- [Core Logic](#core-logic)\n- [Main Characteristics](#main-characteristics)\n- [Download](#download)\n- [Usage](#usage)\n   - [Java Example](#java-example)\n   - [Builder Configurations](#builder-configurations)\n   - [Input Calendar Configurations](#input-calendar-configurations)\n- [Customizing Theme](#customizing-theme)\n   - [Customizing Texts](#customizing-texts)\n- [Stand-Alone Views](#stand-alone-views)\n- [Change Log](#change-log)\n\n\u003cbr/\u003e\n\nCore Logic\n----------\nThe ❤️ of this library is provided by [**PrimeCalendar**](https://github.com/aminography/PrimeCalendar).\n\n\u003cbr/\u003e\n\nMain Characteristics\n--------------------\n- Endless Scrolling\n- Fully Customizable Views \u0026 Themes\n- Align With Material Design\n- Fluent UI\n- RTL Support\n- Landscape Support\n- Various Calendar Types\n- Various Date Picking Strategies\n- Dialog \u0026 BottomSheet Presentations\n- Fast Goto\n\n#### :dart: Download [SampleApp.apk](https://github.com/aminography/PrimeDatePicker/releases/download/v3.4.0/sample-app-release.apk)\n\n\u003cbr/\u003e\n\nDownload\n--------\n**`PrimeDatePicker`** is available on `MavenCentral` to download using build tools systems. Add the following lines to your `build.gradle` file:\n\n```gradle\ndependencies {\n    implementation 'com.aminography:primedatepicker:3.6.0'\n    implementation 'com.aminography:primecalendar:1.7.0'\n}\n```\n\n\u003cbr/\u003e\n\nUsage\n-----\n\nTo enjoy `PrimeDatePicker`, create an instance using a builder pattern in simple 4 steps.\n\n1. Decide on **BottomSheet** or **Dialog** representation along with an initial calendar:\n```kotlin\n// To show a date picker with Civil dates, also today as the starting date\nval today = CivilCalendar()\n\nval datePicker = PrimeDatePicker.bottomSheetWith(today)  // or dialogWith(today)\n```\n\n2. Decide on picking strategy along with passing a proper callback:\n```kotlin\nval callback = SingleDayPickCallback { day -\u003e\n    // TODO\n}\n\nval today = CivilCalendar()\n\nval datePicker = PrimeDatePicker.bottomSheetWith(today)\n        .pickSingleDay(callback)  // or pickRangeDays(callback) or pickMultipleDays(callback)\n```\n\n3. Apply some optional configurations:\n\n```kotlin\n...\n\nval datePicker = PrimeDatePicker.bottomSheetWith(today)\n        .pickSingleDay(callback)\n        .initiallyPickedSingleDay(pickedDay)\n        ...\n```\n\n4. Build the date picker and show it:\n```kotlin\nval callback = SingleDayPickCallback { day -\u003e\n    // TODO\n}\n\nval today = CivilCalendar()\n\nval datePicker = PrimeDatePicker.bottomSheetWith(today)\n        .pickSingleDay(callback)\n        .initiallyPickedSingleDay(pickedDay)\n        .build()\n        \ndatePicker.show(supportFragmentManager, \"SOME_TAG\")\n```\n\n\u003cbr/\u003e\n\n### Java Example\n\n\u003e Java\n```java\nSingleDayPickCallback callback = new SingleDayPickCallback() {\n    @Override\n    public void onSingleDayPicked(PrimeCalendar singleDay) {\n        // TODO\n    }\n};\n\n// To show a date picker with Japanese dates, also today as the starting date\nPrimeCalendar today = new JapaneseCalendar();  \n\nPrimeDatePicker datePicker = PrimeDatePicker.Companion.dialogWith(today)\n    .pickSingleDay(callback)\n    .build();\n\ndatePicker.show(getSupportFragmentManager(), \"SOME_TAG\");\n```\n\n\u003cbr/\u003e\n\n### Builder Configurations\n\nThere are several builder functions applying relevant configurations on the date picker.\n\n\u003cbr/\u003e\n\n\u003ctable\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eFunction\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003ePicking Strategy\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• minPossibleDate(minDate: PrimeCalendar)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eALL\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies the minimum feasible date to be shown in date picker, which is selectable.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• maxPossibleDate(maxDate: PrimeCalendar)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eALL\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies the maximum feasible date to be shown in date picker, which is selectable.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• firstDayOfWeek(firstDayOfWeek: Int)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eALL\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies the day that should be considered as the start of the week. Possible values are: Calendar.SUNDAY, Calendar.MONDAY, etc.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• disabledDays(disabledDays: List\u0026lt;PrimeCalendar\u0026gt;)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eALL\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies the list of disabled days, which aren't selectable.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• applyTheme(themeFactory: ThemeFactory)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eALL\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies the theme.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• initiallyPickedSingleDay(pickedDay: PrimeCalendar)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eSingleDay\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies initially picked day when the date picker has just shown.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• initiallyPickedRangeDays(startDay: PrimeCalendar, endDay: PrimeCalendar)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eRangeDays\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies initially picked range of days when the date picker has just shown.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• autoSelectPickEndDay(autoSelect: Boolean)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eRangeDays\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies automatic selection of picking end day when the start day gets picked.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e• initiallyPickedMultipleDays(pickedDays: List\u0026lt;PrimeCalendar\u0026gt;)\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003eMultipleDays\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003ci\u003eSpecifies initially picked multiple days when the date picker has just shown.\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cbr/\u003e\n\n### Input Calendar Configurations\n\nIn addition to the builder functions, `PrimeDatePicker` receives some configurations from the input calendar. For example:\n\n```kotlin\n// shows a Persian calendar, but in English language, which leads to LTR direction\nval calendar = PersianCalendar(Locale.ENGLISH).also {\n    it.year = 1398                       // determines starting year\n    it.month = 7                         // determines starting month\n    it.firstDayOfWeek = Calendar.MONDAY  // sets first day of week to Monday\n}\n\nval datePicker = PrimeDatePicker.bottomSheetWith(calendar)\n        ...\n        .build()\n```\n\n\u003cbr/\u003e\n\nCustomizing Theme\n-----------------\n\n`PrimeDatePicker` is fully customizable and you can tailor it to what you desire.\nAlmost everything you see is customizable. For example:\n- text sizes \u0026 colors\n- background \u0026 element colors\n- padding \u0026 distances\n- font typeface\n- string formatter\n- calendar animations \u0026 transition parameters\n- *etc*\n\nIn this way, a set of customizable theme factory classes are provided to specify theme parameters.\nBy default, there are two concrete subclasses for the them factory:\n\n- [`DarkThemeFactory`](library/src/main/java/com/aminography/primedatepicker/picker/theme/DarkThemeFactory.kt)\n- [`LightThemeFactory`](library/src/main/java/com/aminography/primedatepicker/picker/theme/LightThemeFactory.kt)\n\nYou can override their parameters, or inherit a class from, or make your own theme factory.\n\nHere is an example of how to override theme parameters to customize it:\n\n```kotlin\nval themeFactory = object : LightThemeFactory() {\n\n    override val typefacePath: String?\n        get() = \"fonts/Righteous-Regular.ttf\"\n    \n    override val dialogBackgroundColor: Int\n        get() = getColor(R.color.yellow100)\n\n    override val calendarViewBackgroundColor: Int\n        get() = getColor(R.color.yellow100)\n\n    override val pickedDayBackgroundShapeType: BackgroundShapeType\n        get() = BackgroundShapeType.ROUND_SQUARE\n\n    override val calendarViewPickedDayBackgroundColor: Int\n        get() = getColor(R.color.green800)\n    \n    override val calendarViewPickedDayInRangeBackgroundColor: Int\n        get() = getColor(R.color.green400)\n\n    override val calendarViewPickedDayInRangeLabelTextColor: Int\n        get() = getColor(R.color.gray900)\n\n    override val calendarViewTodayLabelTextColor: Int\n        get() = getColor(R.color.purple200)\n\n    override val calendarViewWeekLabelFormatter: LabelFormatter\n        get() = { primeCalendar -\u003e\n            when (primeCalendar[Calendar.DAY_OF_WEEK]) {\n                Calendar.SATURDAY,\n                Calendar.SUNDAY -\u003e String.format(\"%s😍\", primeCalendar.weekDayNameShort)\n                else -\u003e String.format(\"%s\", primeCalendar.weekDayNameShort)\n            }\n        }\n\n    override val calendarViewWeekLabelTextColors: SparseIntArray\n        get() = SparseIntArray(7).apply {\n            val red = getColor(R.color.red300)\n            val indigo = getColor(R.color.indigo500)\n            put(Calendar.SATURDAY, red)\n            put(Calendar.SUNDAY, red)\n            put(Calendar.MONDAY, indigo)\n            put(Calendar.TUESDAY, indigo)\n            put(Calendar.WEDNESDAY, indigo)\n            put(Calendar.THURSDAY, indigo)\n            put(Calendar.FRIDAY, indigo)\n        }\n\n    override val calendarViewShowAdjacentMonthDays: Boolean\n        get() = true\n\n    override val selectionBarBackgroundColor: Int\n        get() = getColor(R.color.brown600)\n\n    override val selectionBarRangeDaysItemBackgroundColor: Int\n        get() = getColor(R.color.orange700)\n}\n```\n\n\u003cbr/\u003e\n\nUsing above theme, we can transform the light theme (left picture) to the right one.\n\n\u003cbr/\u003e\n\n\u003ctable\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eNormal Light Theme\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eCustomized Light Theme\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"static/theme_light.png\" width=\"400\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"static/theme_light_customized.png\" width=\"400\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cbr/\u003e\n\n\u003e Java Theme Customization Example\n```java\nBaseThemeFactory themeFactory = new LightThemeFactory() {\n    \n    @NotNull\n    @Override\n    public PrimeCalendarView.FlingOrientation getCalendarViewFlingOrientation() {\n        return PrimeCalendarView.FlingOrientation.HORIZONTAL;\n    }\n    \n    @Override\n    public int getSelectionBarBackgroundColor() {\n        return super.getColor(R.color.green300);\n    }\n    \n    // Other customizations...\n};\n```\n\n\u003cbr/\u003e\n\n### Customizing Texts\n\nIf you want to change some texts in `PrimeDatePicker`, such as a button text, the current solution is to\ndefine some strings in your project's `strings.xml` with equal name defined in the library's `strings.xml`, to override them.\n\n\u003cbr/\u003e\n\nStand-Alone Views\n-----------------\n\nTo see how to use **`PrimeMonthView`** \u0026 **`PrimeCalendarView`**, [refer to wiki page](https://github.com/aminography/PrimeDatePicker/wiki#stand-alone-views) .\n\n\u003cbr/\u003e\n\nChange Log\n----------\n\nThe change log is available [here](https://github.com/aminography/PrimeDatePicker/wiki/Change-Log).\n\n\u003cbr/\u003e\n\nLicense\n--------\n```\nCopyright 2019 Mohammad Amin Hassani.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminography%2Fprimedatepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminography%2Fprimedatepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminography%2Fprimedatepicker/lists"}