alhazmy13 / HijriDatePicker

Material (Gregorian - Hijri) Date & Time Picker
alhazmy13.net
Apache License 2.0
143 stars 63 forks source link

Incorrect parsing #46

Closed anastr closed 3 years ago

anastr commented 3 years ago

I have this code:

val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.US)
dateFormat.calendar = UmmalquraCalendar()

val calendar = UmmalquraCalendar()
calendar.time = dateFormat.parse("30/02/1442")!!  // This will result calendar dated "01/02/1442" !

assert(dateFormat.format(calendar.time) == "30/02/1442")  //  Wrong!

This happen only when dd is 30. It seems every time the day was 30 its parsing always 01.

What I'm trying to do is parsing String date to Calendar object to pass it to HijriDatePickerDialog.

anastr commented 3 years ago

moved to ummalqura-calendar issue