roto93 / react-native-neat-date-picker

An easy to use date picker for react native.
MIT License
52 stars 33 forks source link

Language prop isn't working #16

Closed qaws5503 closed 2 years ago

qaws5503 commented 2 years ago

First, this date rage picker is very great!! Good work to the author.

Recently I update this package to 1.2.4, and found the chinese changed to language. So I changed it to language="cn", and it seems not changing the language it's still english. I've tried to change to other values such as 'en', 'cn', 'de', 'es', 'fr', 'pt'. And all of it doesn't work. Maybe there's an bug here

My environment:
Expo: 44.0.0
react-native: 0.64.3
roto93 commented 2 years ago

Hi, I'm trying to figure out where the problem is. But I found that the language functionality is ok in the later version.

My testing environment:
Expo: 45.0.0
react-native: 0.68.2

However, I don't think the version of Expo and react-native would cause your issue. Could you provide a reproduction?

qaws5503 commented 2 years ago

Strange thing, I tried to reproduce the problem on expo snack. But the language props seems working well on expo snack, I'll try to do more test in the future.

By the way, when I test today the latest version is 1.3.0 and I encounter a different problem. My command line has an error, I'll paste it below.

SyntaxError: file/to/root/node_modules/react-native-neat-date-picker/src/components/NeatDatePicker.js: Unexpected token, expected "," (280:4)

  278 | NeatDatePicker.defaultProps = {
  279 |     dateStringFormat: 'yyyy-MM-dd'
> 280 |     modalStyles: { justifyContent: 'center' }
      |     ^
  281 | }
  282 |
  283 | // Notice: only six-digit HEX values are allowed.
roto93 commented 2 years ago

Oh! There is a missing comma there. I just fixed it and update to version 1.3.1 . Thank you. As for the language problem, How about trying to reinstall the package in your project? It might help.

qaws5503 commented 2 years ago

Solve it by deleting node_modules file and then reinstall all. Maybe there is some install issue in my local environment. Thanks for your help!!