android-times-square icon indicating copy to clipboard operation
android-times-square copied to clipboard

Week in Arabic is shown two days ahead

Open eslamwael74 opened this issue 8 years ago • 4 comments

The calender shows the current date two days ahead. Example, if today is 13th Seb Wednesday then in Arabic it is showing 13th Sep Friday. How can this is solved?

calendarView.init(today,nextYear.getTime(),new Locale("ar","EG")). inMode(CalendarPickerView.SelectionMode.MULTIPLE);

eslamwael74 avatar Sep 13 '17 18:09 eslamwael74

+1 Facing the same issue with Bengali(bn) language

ashish21 avatar Mar 04 '18 13:03 ashish21

I found the problem and was able to work around it by forking the library and editing isRtl

view.isRtl = false; // was isRtl(locale);

this changes the order of days and it now starts from Saturday but at least it displays the correct day.

I won't be submitting a pull request since my solution changes the appearance slightly and if the maintainers want to use it is just one line.

here is my fork that contains the fix: https://github.com/humazed/android-times-square

you can use from; https://jitpack.io/#humazed/android-times-square

implementation 'com.github.humazed:android-times-square:1.7.12-SNAPSHOT-1'

here is how it looks now:

image

humazed avatar Feb 26 '19 13:02 humazed

So small update here in case someone else is in the same situation.

I have device with language setting like: Settings

During debug I found that Locale.getDefault() returns en_NL which is second one in the android settings.

However, if I use new API LocaleList.getDefault() it returns correct list of locales that exact same as in the device settings.

With the code:

        val locale = LocaleListCompat.getDefault()[0]
        calendarView.init(currentDate, maxDate, locale)

I achieved next result: Calendar

Notice that week starts on Saturday and there is compat version of LocaleList to work on the older API.

emartynov avatar Sep 08 '20 12:09 emartynov

This is nothing related to RTL language. So please excuse me for the message above.

emartynov avatar Sep 08 '20 12:09 emartynov