Closed flibbertigibbet closed 6 years ago
Update: I've gotten this to work on Android by explicitly setting the date format symbols. This required making the class UmmalquraDateFormatSymbols
public.
SimpleDateFormat dateFormat = new SimpleDateFormat(formatString, locale);
dateFormat.setCalendar(cal);
UmmalquraDateFormatSymbols ummalquara = new UmmalquraDateFormatSymbols();
DateFormatSymbols symbols = new DateFormatSymbols(locale);
symbols.setMonths(ummalquara.getMonths());
symbols.setShortMonths(ummalquara.getShortMonths());
dateFormat.setDateFormatSymbols(symbols);
outputs:
calendar getTime: Tue Jun 21 14:51:12 EDT 2016
formatted full date: Tuesday 16 Ramadhan, 1437
Thank you for your workaround but it doesn't work with me until i add " locale " on this line
UmmalquraDateFormatSymbols ummalquara = new UmmalquraDateFormatSymbols(locale);
Regards
I think this is related to Android implementation as it's working fine on JDK. Please check:
com.github.msarhan.ummalqura.calendar.UmmalquraDateFormatTests::formatDate(Calendar cal, Locale l, String fmt)
Running the examples in the README outputs Gregorian months from a
SimpleDateFormatter
. Compiling for Android with target API 23.outputs:
Initializing instead with the current date and time:
Calendar cal = UmmalquraCalendar.getInstance();
outputs in all Gregorian:Thanks for building this project!