Skip to content
Persian DatePicker for Android applications
Kotlin PureBasic
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle/wrapper
lineardatepicker
shots
.gitignore
.travis.yml
LICENSE.md
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Persian Date Picker

An easy to use Android library to pick a date.

API Build Status Codacy Badge ktlint

You can set the minimum and maximum dates to be shown to the user. After user selects the desired date, you can get the year, month and day separator or joined together by any separator you like.

Also the numbers are shown in Persian by default to users.

Description

Library

This project is made by Kotlin and AndroidX completely and is not a forked or refactored code. The design is inspired by PersianDatePicker.

Current Functions

Functions that are available in this library are:

  • setMaxYear
  • setMinYear
  • setDate
  • getSelectedYear
  • getSelectedMonth
  • getSelectedDay
  • getFormattedDate
  • getPersianFormattedDate
  • setOnDateChangedListener

Usage

First add maven repository to your project level gradle file:

   allprojects {
      repositories {
		maven { url 'https://jitpack.io' }
		}
	}

Then add the dependency:

  dependencies {
     implementation 'com.github.SirLordPouya:PersianLinearDatePicker:1.2.0'
   }

Add PersianLinearDatePicker view to your xml:

    <com.pouyaheydari.lineardatepicker.PersianLinearDatePicker
        android:id="@+id/datePicker"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:maxYear="1420"
        app:minYear="1320" />

Note that maxYear and minYear are optional. If you dont set any values for minYear or maxYear, 1320..1420 will be used as default values.

TODO

I will add these features in the future:

  • Calculating leap years
  • Converting a date to Gregorian date

License

PersianLinearDatePicker is released under the Apache License 2.0. See LICENSE for details.

Copyright (c) 2020 Pouya Heydari

This App icon and style is designed by Amir Gerdakane

You can’t perform that action at this time.