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

seconds and minutes not in the right order in RTL languages(like hebarw and Arabic) #87

Open
Eliav2 opened this issue Aug 4, 2020 · 3 comments

Comments

@Eliav2
Copy link

Eliav2 commented Aug 4, 2020

I using your component in Hebrew project language. in Hebrew, the elements are printed from right to left(RTL) in the order you specify them in the React Tree(not like English which prints the elements from left to right). this causes the seconds to be on the right instead of the left (meaning if the time that reminded is 12 minutes and 50 seconds it will be printed 50:12 instead of 12:50)

it could be very nice if there was an option to print elements from right to left. (in the term of your components instead of using flexDirection row using row-reversed)

you can also just add a containerStyle property chich will enable the user to override your default style(which currently always use flexDirection="row")

@Eliav2 Eliav2 changed the title seconds and minutes not in the right order int RTL languages(like hebarw and Arabic) seconds and minutes not in the right order in RTL languages(like hebarw and Arabic) Aug 4, 2020
@jeffelector
Copy link

Same Problem here !
need to change the render method on renderCountDown to this:
{
I18nManager.isRTL?
<View style={{flexDirection:'row'}}>
{showSeparator && timeToShow.includes('M') && timeToShow.includes('S') ? this.renderSeparator() : null}
{timeToShow.includes('S') ? this.renderDoubleDigits(timeLabels.s, newTime[3]) : null}
{showSeparator && timeToShow.includes('H') && timeToShow.includes('M') ? this.renderSeparator() : null}
{timeToShow.includes('M') ? this.renderDoubleDigits(timeLabels.m, newTime[2]) : null}
{showSeparator && timeToShow.includes('D') && timeToShow.includes('H') ? this.renderSeparator() : null}
{timeToShow.includes('H') ? this.renderDoubleDigits(timeLabels.h, newTime[1]) : null}
{timeToShow.includes('D') ? this.renderDoubleDigits(timeLabels.d, newTime[0]) : null}

:
<View style={{flexDirection:'row'}}>
{timeToShow.includes('D') ? this.renderDoubleDigits(timeLabels.d, newTime[0]) : null}
{showSeparator && timeToShow.includes('D') && timeToShow.includes('H') ? this.renderSeparator() : null}
{timeToShow.includes('H') ? this.renderDoubleDigits(timeLabels.h, newTime[1]) : null}
{showSeparator && timeToShow.includes('H') && timeToShow.includes('M') ? this.renderSeparator() : null}
{timeToShow.includes('M') ? this.renderDoubleDigits(timeLabels.m, newTime[2]) : null}
{showSeparator && timeToShow.includes('M') && timeToShow.includes('S') ? this.renderSeparator() : null}
{timeToShow.includes('S') ? this.renderDoubleDigits(timeLabels.s, newTime[3]) : null}

          </View>
    }

this is a temp solution.. hope he will fix the problem asap.

@jeffelector
Copy link

@talalmajali

@Eliav2
Copy link
Author

Eliav2 commented Aug 18, 2020

hey @jeffelector ,
i solved this by just copying the index.js file into local component file and changed timeCont style:

import { I18nManager } from "react-native";
 timeCont: {
    flexDirection: I18nManager.isRTL ? "row-reverse" : "row",
    justifyContent: "center",
  },

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

No branches or pull requests

2 participants