Search code examples
iosswiftuidatepickerhijri

islamicUmmAlQura UIDatePicker is not working properly


I am using islamicUmmAlQura UIDatePicker while developing iOS application as shown in the following picture

and I have TWO problems summarised as follows:

1- The date that appears in the text field is gregorian while my UIDatePicker is islamic (Hijri) see figure

2- Sometimes the days in the Textfields are above normal! see figure


Solution

  • I have an extension on github to convert dates. Have a look. mine is persian date so you just need to replace the below code with mine inside the extension:

    datePicker.calendar = Calendar(identifier: .islamicUmmAlQura)
    

    [https://github.com/Fridday/PersianDatePicker][1]