Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week in Arabic is shown two days ahead #388

Open
eslamwael74 opened this issue Sep 13, 2017 · 4 comments
Open

Week in Arabic is shown two days ahead #388

eslamwael74 opened this issue Sep 13, 2017 · 4 comments
Labels

Comments

@eslamwael74
Copy link

eslamwael74 commented Sep 13, 2017

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);

@ashish21
Copy link

ashish21 commented Mar 4, 2018

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

@edenman edenman added the bug label Jul 3, 2018
@edenman edenman changed the title Week in Arabic Week in Arabic is shown two days ahead Jul 3, 2018
@humazed
Copy link

humazed commented Feb 26, 2019

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 added a commit to humazed/android-times-square that referenced this issue Feb 26, 2019
@emartynov
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants