All Projects → mohsenjahani → JalaliMaterialDateTimePicker

mohsenjahani / JalaliMaterialDateTimePicker

Licence: Apache-2.0 license
Pick a date or time for Android with support Gregorian and Jalali calendar at the same time

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to JalaliMaterialDateTimePicker

uni-lb-picker
uni-app picker选择器,可自定义,扩展性高,支持单选及理论任意级数多级联动选择。
Stars: ✭ 42 (+75%)
Mutual labels:  picker
EasyAlbum
📷 A lightweight, pure-Swift library for pick up photo from your album.
Stars: ✭ 31 (+29.17%)
Mutual labels:  picker
react-material-color-picker
react-material-color-picker component for selecting colors from google material color palette 📃
Stars: ✭ 19 (-20.83%)
Mutual labels:  picker
ColorPicker
A HSV style Color Picker Dialog library for Android (with Alpha setting)
Stars: ✭ 16 (-33.33%)
Mutual labels:  picker
colr pickr
Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.
Stars: ✭ 27 (+12.5%)
Mutual labels:  picker
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (+150%)
Mutual labels:  picker
react-native-color-panel
React Native Color Panel Component for iOS and Android 🏳️‍🌈
Stars: ✭ 21 (-12.5%)
Mutual labels:  picker
jquery-datepicker
A full-featured datepicker jquery plugin
Stars: ✭ 35 (+45.83%)
Mutual labels:  picker
react-native-simple-picker
A simple picker for React Native.
Stars: ✭ 89 (+270.83%)
Mutual labels:  picker
vscode-color
Helper with GUI to generate color codes such as CSS color notations.
Stars: ✭ 88 (+266.67%)
Mutual labels:  picker
clocklet
An opinionated clock-style vanilla-js timepicker.
Stars: ✭ 31 (+29.17%)
Mutual labels:  picker
EmojiPicker
This library to show a popover to select emoji for iOS
Stars: ✭ 58 (+141.67%)
Mutual labels:  picker
mr-emoji
Lightweight emoji picker like SLACK
Stars: ✭ 23 (-4.17%)
Mutual labels:  picker
pcal
Command line tool to convert Gregorian calendar dates to Persian calendar dates
Stars: ✭ 22 (-8.33%)
Mutual labels:  jalali-calendar
aka-ios-beacon
The missing binding framework for iOS
Stars: ✭ 13 (-45.83%)
Mutual labels:  picker
PhoneCountryCodePicker
An iOS tableview picker for PhoneCountryCode (English & Chinese supported)
Stars: ✭ 31 (+29.17%)
Mutual labels:  picker
datium
⏰ The flexible DataTime Package written in PHP
Stars: ✭ 18 (-25%)
Mutual labels:  jalali-calendar
react-native-multi-selectbox
Platform independent (Android / iOS) Selectbox | Picker | Multi-select | Multi-picker. The idea is to bring out the common user interface & user experience on both platforms.
Stars: ✭ 169 (+604.17%)
Mutual labels:  picker
vue-daterangepicker-component
Date range picker for Vue 1.x, based on bootstrap-daterangepicker
Stars: ✭ 22 (-8.33%)
Mutual labels:  picker
Fluent-Random-Picker
Fluent Random Picker is a nice, performant, fluent way to pick random values. Probabilities can be specified, values can be weighted.
Stars: ✭ 26 (+8.33%)
Mutual labels:  picker

Persian Jalali Material DateTime Picker

With this library you can pick a date or time for Android, with support Gregorian and Jalali calendar in the same time. this library is based on the main library (https://github.com/wdullaer/MaterialDateTimePicker) and only the persian jalali calendar and custom font added to it.

Setup

Just add this line to your build.gradle dependencies :

dependencies {
    implementation 'ir.scriptestan.jalalimaterialdatetimepicker:library:0.1.2'
}

Screenshots

Gregorian Persian Jalali
Date Picker Gregorian Date Picker Persian Jalali
Time Picker Gregorian Time Picker Persian Jalali

Simple usage

class MainActivity : AppCompatActivity(), DatePickerDialog.OnDateSetListener {
    var dpd: DatePickerDialog? = null

    // Change this
    var calendarType: DatePickerDialog.Type = DatePickerDialog.Type.JALALI // or DatePickerDialog.Type.GREGORIAN

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        button.setOnClickListener {
            val now: Calendar? = when (calendarType) {
                DatePickerDialog.Type.GREGORIAN -> Calendar.getInstance()
                DatePickerDialog.Type.JALALI -> JalaliCalendar.getInstance()
            }

            /**
             * Date picker setup
             */
            if (dpd == null) {
                dpd = DatePickerDialog.newInstance(
                    calendarType,
                    this,
                    now!!.get(Calendar.YEAR),
                    now.get(Calendar.MONTH),
                    now.get(Calendar.DAY_OF_MONTH)
                )
            } else {
                dpd!!.calendarType = calendarType
                dpd!!.initialize(
                    this,
                    now!!.get(Calendar.YEAR),
                    now.get(Calendar.MONTH),
                    now.get(Calendar.DAY_OF_MONTH)
                )
            }

            /**
             * For setting font
             *
            when (dpd?.calendarType) {
                DatePickerDialog.Type.GREGORIAN -> dpd!!.setFont(null)
                DatePickerDialog.Type.JALALI -> {
                    dpd!!.setFont(Typeface.createFromAsset(assets, "IRANSansMobile(FaNum).ttf"))
                }
            }
            */

            /**
             * Showing date picker
             */
            dpd!!.show(supportFragmentManager, "DatePickerDialog")
        }
    }

    override fun onDateSet(view: DatePickerDialog?, year: Int, monthOfYear: Int, dayOfMonth: Int) {
        Toast.makeText(this,
            "Picked date: $dayOfMonth/${monthOfYear+1}/$year", Toast.LENGTH_LONG).show()
    }
}

for more options see sample folder or main library readme

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