All Projects → alibehzadian → Persiandatepicker

alibehzadian / Persiandatepicker

Licence: apache-2.0
An Android DatePicker for Persian Calendar

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Persiandatepicker

React Modern Calendar Datepicker
A modern, beautiful, customizable date picker for React
Stars: ✭ 555 (+545.35%)
Mutual labels:  persian, calendar, datepicker
Vue Hotel Datepicker
Vue date range picker component
Stars: ✭ 665 (+673.26%)
Mutual labels:  calendar, datepicker
Ion2 Calendar
📅 A date picker components for ionic2 /ionic3 / ionic4
Stars: ✭ 537 (+524.42%)
Mutual labels:  calendar, datepicker
Rsdayflow
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.
Stars: ✭ 843 (+880.23%)
Mutual labels:  calendar, datepicker
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (+398.84%)
Mutual labels:  calendar, datepicker
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (+523.26%)
Mutual labels:  calendar, datepicker
Vue Calendar
🏆 基于 vue 2.0 开发的轻量,高性能日历组件
Stars: ✭ 828 (+862.79%)
Mutual labels:  calendar, datepicker
Rkcalendar
SwiftUI Simple Calendar / Date Picker for iOS
Stars: ✭ 349 (+305.81%)
Mutual labels:  calendar, datepicker
Persianrangedatepicker
Persian range date picker for android.
Stars: ✭ 48 (-44.19%)
Mutual labels:  persian, datepicker
Vue Draggablecal
Not your ordinary datepicker. A Vuejs draggable date selector with a fresh responsive design, mobile ready and 0 dependencies, 17kb gzipped
Stars: ✭ 79 (-8.14%)
Mutual labels:  calendar, datepicker
React Native Jalali Datepicker
📅 React Native Jalali DatePicker component for both Android and iOS ✨
Stars: ✭ 52 (-39.53%)
Mutual labels:  persian, datepicker
React Infinite Calendar
✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.
Stars: ✭ 3,828 (+4351.16%)
Mutual labels:  calendar, datepicker
Vue Persian Datetime Picker
A vue plugin to select jalali date and time
Stars: ✭ 380 (+341.86%)
Mutual labels:  persian, datepicker
Zebra datepicker
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin
Stars: ✭ 367 (+326.74%)
Mutual labels:  calendar, datepicker
Horizontal Calendar
A material horizontal calendar view for Android based on RecyclerView
Stars: ✭ 1,155 (+1243.02%)
Mutual labels:  calendar, datepicker
Vue Ctk Date Time Picker
VueJS component to select dates & time, including a range mode
Stars: ✭ 707 (+722.09%)
Mutual labels:  calendar, datepicker
Primedatepicker
PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days.
Stars: ✭ 292 (+239.53%)
Mutual labels:  calendar, datepicker
Vue Functional Calendar
Vue.js Functional Calendar | Component/Package
Stars: ✭ 314 (+265.12%)
Mutual labels:  calendar, datepicker
React Calendar
A React Native inspired date list renderer
Stars: ✭ 34 (-60.47%)
Mutual labels:  calendar, datepicker
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+1139.53%)
Mutual labels:  calendar, datepicker

PersianDatePicker

An Android DatePicker for Persian Calendar

ScreenShot ScreenShot

Usage:

  • Add as an Android Library Project:
  • Add this line to root layout element:
xmlns:persianDatePicker="http://schemas.android.com/apk/res-auto"
  • Add PersianDatePicker view:
<ir.smartlab.persindatepicker.PersianDatePicker
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
  • Add Source and other required things to your Project:
  • Copy all sources to your source tree.
  • Copy /res/layout/sl_persian_date_picker.xml to your /res/layout folder.
  • Add this to your /res/values/attrs.xml:
<declare-styleable name="PersianDatePicker">
        <attr name="minYear" format="integer" />
        <attr name="maxYear" format="integer" />
        <attr name="selectedYear" format="integer" />
        <attr name="selectedMonth" format="integer" />
        <attr name="selectedDay" format="integer" />
        <attr name="displayMonthNames" format="boolean" />
        <attr name="yearRange" format="integer" />
    </declare-styleable>

Params:

  • minYear: Min value for year in the picker. Default is current Hijri Shamsi (Jalali) year - yearRange(default is 10).
  • maxYear: Max value for year in the picker. Default is current Hijri Shamsi (Jalali) year + yearRange(default is 10).
  • yearRange: If you set a selected year, available years in picker will be from (selectedYear - yearRange) to (selectedYear + yearRange). Default value is 10.
  • selectedYear: Selected year that PersianDatePicker starts with. Default is the current Hijri Shamsi (Jalali) year.
  • selectedMonth: Selected month that PersianDatePicker starts with. Default is the current Hijri Shamsi (Jalali) year's month.
  • selectedDay: Selected day of month that PersianDatePicker starts with. Default is the current Hijri Shamsi (Jalali) month's day.
  • displayMonthNames: If set to true, months names are displayed, otherwise their number will be shown.
  • displayDescription: If set to true, a TextView below datepicker will show the selected date with more details.

Examples:

  • Display a PersianDatePicker with current Hijri Shamsi (Jalali) values:
<ir.smartlab.persindatepicker.PersianDatePicker
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
  • Display a PersianDatePicker with selected Hijri Shamsi (Jalali) date:
    <ir.smartlab.persindatepicker.PersianDatePicker
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:selectedYear="1390"
    app:selectedMonth="5"
    app:selectedDay="15" />
  • Display a PersianDatePicker that shows month names:
<ir.smartlab.persindatepicker.PersianDatePicker
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:displayMonthNames="true" />
  • Display a PersianDatePicker that shows years between 1350 and 1450:
<ir.smartlab.persindatepicker.PersianDatePicker
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:maxYear="1450"
        app:minYear="1350" />

Java Examples:

  • You can set a java.util.Date object to PersianDatePpicker in java code:
persianDatePicker.setDisplayDate(new Date());
  • you can also set a ir.smartlab.persindatepicker.util.PersianCalendar object:
PersianCalendar persianCalendar = new PersianCalendar();
persianCalendar.setPersianDate(1393, 6, 28);
persianDatePicker.setDisplayPersianDate(persianCalendar);
  • You can get displayed date in java.util.Date or ir.smartlab.persindatepicker.util.PersianCalendar:
Date d = persianDatePicker.getDisplayDate();
// OR
PersianCalendar pCal = persianDatePicker.getDisplayPersianDate();

Leap Year:

In Hijri Shamsi some years are leap year, so the last month of year is 30 days (not 29 days). PersianDatePicker take cares of leap years. This means that users will never pick a wrong date.

To Do:

  • Support Persian digits as an option
  • Support typeface settings

Credits:

PersianDatepicker is heavily based on AOSP (https://source.android.com) and persian-calendar (https://github.com/mortezaadi/persian-calendar).

Version

1.0

License

Apache License Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].