diff --git a/singledateandtimepicker/src/main/java/com/github/florent37/singledateandtimepicker/widget/WheelPicker.java b/singledateandtimepicker/src/main/java/com/github/florent37/singledateandtimepicker/widget/WheelPicker.java index 10f96f96..7847ffbc 100644 --- a/singledateandtimepicker/src/main/java/com/github/florent37/singledateandtimepicker/widget/WheelPicker.java +++ b/singledateandtimepicker/src/main/java/com/github/florent37/singledateandtimepicker/widget/WheelPicker.java @@ -1032,13 +1032,20 @@ public Locale getCurrentLocale() { return customLocale; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - return getResources().getConfiguration().getLocales().get(0); + return getArabicLocale(getResources().getConfiguration().getLocales().get(0)); } else { //noinspection deprecation - return getResources().getConfiguration().locale; + return getArabicLocale(getResources().getConfiguration().locale); } } + private Locale getArabicLocale(Locale locale) { + Locale value = new Locale("ar","LY") ; + if (locale.getLanguage().equals(value.getLanguage())) { + return value ; + }else return locale ; + } + public void setDateHelper(DateHelper dateHelper) { this.dateHelper = dateHelper; }