Open atifaziz1 opened 1 year ago
@atifaziz1 I think you are parsing the date in the wrong way; you cannot set the month to 30. Can you share your code?
@alhazmy13 Thanks for your quick response.
Here is my code
UmmalquraCalendar now = new UmmalquraCalendar();
HijriDatePickerDialog hijriDatePickerDialog = HijriDatePickerDialog.newInstance(listener,now.get(UmmalquraCalendar.YEAR), now.get(UmmalquraCalendar.MONTH), now.get(UmmalquraCalendar.DAY_OF_MONTH));`
@alhazmy13 If i do
UmmalquraCalendar now = new UmmalquraCalendar();
HijriDatePickerDialog hijriDatePickerDialog = HijriDatePickerDialog.newInstance(listener, now.get(Calendar.YEAR), now.get(Calendar.MONTH),now.get(Calendar.DAY_OF_MONTH));
I am getting com.github.msarhan.ummalqura.calendar.DateTimeException: Invalid Hijrah day of month: 31
error
@msarhan please help required. It's urgent.
@atifaziz1 I believe this related to HijriDatePicker it could be using an old version of UmmalquraCalendar
or something like that, ill dig deep on the library to find the root case of this issue
@alhazmy13 I hope you will fix this issue on priority bases. Thanks.
Yes sir @atifaziz1 , you are using the library in the wrong way, please update your code to below:
UmmalquraCalendar now = new UmmalquraCalendar();
HijriDatePickerDialog dpd = HijriDatePickerDialog.newInstance(
this,
now.get(UmmalquraCalendar.YEAR),
now.get(UmmalquraCalendar.MONTH),
now.get(UmmalquraCalendar.DAY_OF_MONTH));
dpd.show(getFragmentManager(), "HijriDatePickerDialog");
more details: https://github.com/alhazmy13/HijriDatePicker#create-a-hijridatepickerdialog
Dear @alhazmy13 !
Please look at my first comment, i am writing the code same as you mentioned.
UmmalquraCalendar now = new UmmalquraCalendar();
HijriDatePickerDialog hijriDatePickerDialog = HijriDatePickerDialog.newInstance(listener,
now.get(UmmalquraCalendar.YEAR),
now.get(UmmalquraCalendar.MONTH),
now.get(UmmalquraCalendar.DAY_OF_MONTH));`
@atifaziz1 Did you fixed it ? I'm stuck at this error
@msarhan @alhazmy13 Hello , I have the same exception when I choose day 30 from any month then choose day 29 from another month I get this exception . I use version 2.0.2
Here is my code
private fun showHijriDatePicker(
editText: TextInputEditText,
isFromDatePicker: Boolean = false
) {
val datePicker = HijriDatePickerDialog.newInstance(
{ _, year, monthOfYear, dayOfMonth ->
when (isFromDatePicker) {
true -> {
fromDateValue = formatHijriDate(year, monthOfYear, dayOfMonth)
}
false -> {
toDateValue = formatHijriDate(year, monthOfYear, dayOfMonth)
}
}
editText.setText(formatHijriDate(year, monthOfYear, dayOfMonth))
},
ummalquraCalendar.get(UmmalquraCalendar.YEAR),
ummalquraCalendar.get(UmmalquraCalendar.MONTH),
ummalquraCalendar.get(UmmalquraCalendar.DAY_OF_MONTH)
)
}
I am facing issue that hijrah date is invalid.. This error is exist in both version 2.0.1 and 2.0.2.
Any help.? @msarhan @alhazmy13
Error Screen shot is attached.