Search code examples
androidandroid-layoutdatepickerpersiancustom-widgets

How to feed DatePicker widget with other calendar sytems?


Is there anyway to use DatePicker widget with other calendar systems ?

I need a picker for Jalali (Persian) Calendar system, but i dont know how to feed DatePicker with my data.

I've studied methods related to DatePicker but couldn't find anything that allows me to do that.

I also found a custom widget called android-wheel, its a iOS-styled widget and does not feel native, but it allows me to implement this.

so is there anyway to have a native-looking DatePicker widget that allows me to pick date for Jalali Calendar system and have month names in persian ?

UPDATE: I've previously answered my question and it solves the problem, But @Mohamad Amin has created a great library for that, and i strongly advise you to use his library (Thanks Mohamad Amin).


Solution

  • Recently, I created a new library that has a Persian (Hijri/Shamsi) Date Picker and it's design is based on Material Design Pickers. You can get more information in the library's github page.

    A screenshot from the DatePickerDialog :

    A **screenshot** from the DatePickerDialog