All Projects → aliab → Persian Date Picker Dialog

aliab / Persian Date Picker Dialog

Persian Date Picker Dialog for Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Persian Date Picker Dialog

Vue Persian Datetime Picker
A vue plugin to select jalali date and time
Stars: ✭ 380 (+85.37%)
Mutual labels:  persian, datepicker
react-calendar-datetime-picker
A simple and fast date and time picker component for React
Stars: ✭ 58 (-71.71%)
Mutual labels:  datepicker, persian
React Native Jalali Datepicker
📅 React Native Jalali DatePicker component for both Android and iOS ✨
Stars: ✭ 52 (-74.63%)
Mutual labels:  persian, datepicker
PersianDateRangePicker
Select range of date and time in the Persian
Stars: ✭ 41 (-80%)
Mutual labels:  datepicker, persian
React Modern Calendar Datepicker
A modern, beautiful, customizable date picker for React
Stars: ✭ 555 (+170.73%)
Mutual labels:  persian, datepicker
Persianrangedatepicker
Persian range date picker for android.
Stars: ✭ 48 (-76.59%)
Mutual labels:  persian, datepicker
Persiandatepicker
An Android DatePicker for Persian Calendar
Stars: ✭ 86 (-58.05%)
Mutual labels:  persian, datepicker
Datepickk
Simple, beautiful and powerful datepicker!
Stars: ✭ 160 (-21.95%)
Mutual labels:  datepicker
Persian Ner
پیکره بزرگ شناسایی موجودیت‌های نامدار فارسی برچسب خورده
Stars: ✭ 183 (-10.73%)
Mutual labels:  persian
Vue Ui For Pc
基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等
Stars: ✭ 156 (-23.9%)
Mutual labels:  datepicker
Dntpersianutils.core
DNTPersianUtils.Core is a collection of Persian helper extension methods
Stars: ✭ 148 (-27.8%)
Mutual labels:  persian
Things Calendar
Simple but elegant datepicker for the web — inspired by Things for mac
Stars: ✭ 165 (-19.51%)
Mutual labels:  datepicker
Android Pickerview
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)
Stars: ✭ 13,003 (+6242.93%)
Mutual labels:  datepicker
Moratab
Persian markdown editor.
Stars: ✭ 156 (-23.9%)
Mutual labels:  persian
React Datepicker2
react datepicker component.(include persian jalaali calendar)
Stars: ✭ 191 (-6.83%)
Mutual labels:  datepicker
Air Datepicker
Lightweight, dependency-free JavaScript datepicker.
Stars: ✭ 1,913 (+833.17%)
Mutual labels:  datepicker
Lightpick
(deprecated) Check out the new date picker Litepicker
Stars: ✭ 204 (-0.49%)
Mutual labels:  datepicker
Vuetify Daterange Picker
The missing date range picker for Vuetify JS you have been looking for.
Stars: ✭ 192 (-6.34%)
Mutual labels:  datepicker
Awesome Persian Youtubers
لیست بهترین یوتیوبرهای فارسی زبان
Stars: ✭ 166 (-19.02%)
Mutual labels:  persian
Vue Tailwind Picker
🎉 Datepicker component for vue.js build with Tailwind CSS & dayjs date library
Stars: ✭ 170 (-17.07%)
Mutual labels:  datepicker

Persian Date Picker Dialog

Hero Image

Persian Date Picker Dialog

This library provides you a beautiful Persian Date picker dialog with easy API.

Usages

Use this dependency in your build.gradle file to reference this library in your project

Step 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
    implementation 'com.github.aliab:Persian-Date-Picker-Dialog:1.5.2'
}

Then in your Java Code, you use it like below.

 picker = new PersianDatePickerDialog(this)
                .setPositiveButtonString("باشه")
                .setNegativeButton("بیخیال")
                .setTodayButton("امروز")
                .setTodayButtonVisible(true)
                .setMinYear(1300)
                .setMaxYear(PersianDatePickerDialog.THIS_YEAR)
                .setInitDate(initDate)
                .setActionTextColor(Color.GRAY)
                .setTypeFace(typeface)
                .setTitleType(PersianDatePickerDialog.WEEKDAY_DAY_MONTH_YEAR)
                .setShowInBottomSheet(true)
                .setListener(new Listener() {
                    @Override
                    public void onDateSelected(PersianCalendar persianCalendar) {
                    Log.d(TAG, "onDateSelected: "+persianCalendar.getGregorianChange());//Fri Oct 15 03:25:44 GMT+04:30 1582
                        Log.d(TAG, "onDateSelected: "+persianCalendar.getTimeInMillis());//1583253636577
                        Log.d(TAG, "onDateSelected: "+persianCalendar.getTime());//Tue Mar 03 20:10:36 GMT+03:30 2020
                        Log.d(TAG, "onDateSelected: "+persianCalendar.getDelimiter());//  /
                        Log.d(TAG, "onDateSelected: "+persianCalendar.getPersianLongDate());// سه‌شنبه  13  اسفند  1398
                        Log.d(TAG, "onDateSelected: "+persianCalendar.getPersianLongDateAndTime()); //سه‌شنبه  13  اسفند  1398 ساعت 20:10:36
                        Log.d(TAG, "onDateSelected: "+persianCalendar.getPersianMonthName()); //اسفند
                        Log.d(TAG, "onDateSelected: "+persianCalendar.isPersianLeapYear());//false
                        Toast.makeText(context, persianCalendar.getPersianYear() + "/" + persianCalendar.getPersianMonth() + "/" + persianCalendar.getPersianDay(), Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onDismissed() {

                    }
                });

        picker.show();

If you need to set an initial date, just simply set it like below.

 PersianCalendar initDate = new PersianCalendar();
 initDate.setPersianDate(1370, 3, 13);

 persianDatePickerDialog.setInitDate(initDate)

Support for BottomSheet

For the OS version after lollipop, if you set setShowInBottomSheet(true) it will show date picker in bottomsheet dialog.

Public Methods

Name Description
setMaxYear(int) set maximum year can be selected
setMinYear(int) set minimum year can be selected
setTypeFace(TypeFace) set dialog typeface
setInitDate(PersianCalendar) set date that dialog will launch on that
setInitDate(PersianCalendar,boolean) set date that dialog will launch on that and force min/max year to be compatible with it
setPositiveButtonString(String) set positive button text
setPositiveButtonResource(@StringRes int) set positive button text from strings.xml
setNegativeButton(String) set negative button text
setNegativeButtonResource(@StringRes int) set negative button text from strings.xml
setTodayButton(String) set today button text
setTodayButtonResource(@StringRes int) set today button text from strings.xml
setTodayButtonVisible(boolean) set today button visible/invisible
setActionTextColor(@ColorInt int) set dialog buttons texts color
setActionTextColorResource(@ColorRes int) set dialog buttons texts color form colors.xml
setCancelable(boolean) set dialog cancelable or not
setBackgroundColor(@ColorInt int) set dialog background color
setPickerBackgroundColor(@ColorInt int) set date pickers background color
setTitleType(NO_TITLE/DAY_MONTH_YEAR/WEEKDAY_DAY_MONTH_YEAR) It will handle title show scenarios
setPickerBackgroundDrawable(@DrawableRes int) set date pickers background drawable from res/drawable folder
setListener(Listener) set dialog callback listener

STYLING

If you want to change picker text color or divider color you can set it via an easy style in your base application Theme, add

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
         
         <!-- Refrence your picker theme here -->
        <item name="numberPickerTheme">@style/customNumberPicker</item>
 </style>

 <!-- Here is your custom date picker theme -->
 <style name="customNumberPicker">
        <!-- use this for text color -->
        <item name="android:textColorPrimary">@android:color/holo_green_dark</item>
         
        <!-- use this for divider color -->
        <item name="colorControlNormal">@android:color/holo_purple</item>
 </style>

CREDITS

License

   
The MIT License (MIT)

Copyright (c) 2018 Ali Abdolahi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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].