web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
642 stars 166 forks source link

intl dependency crash for android #199

Closed NajeebUllah161 closed 1 year ago

NajeebUllah161 commented 1 year ago

When opening either eith DatePickerModal or TimePickerModal on android returns with a crash to download this dependency npm install intl and add this inside src/Time/TimePicker.tsx :

import 'intl'; import 'intl/locale-data/jsonp/en';

FIXES the problem!

juliaosneto commented 1 year ago

Hi!!! NajeebUllah161, good catch, good job, It is a best solution to the issue, thank you. I was giving up on this library, it is very good, it just needs to improve the documentation, the collaborators have to publish this solution soon in main

juliaosneto commented 1 year ago

Hello!!!

first install dependency - npm install intl second go to folder \node_modules\react-native-paper-dates\src\Time\TimePicker.tsx and import 'intl'; import 'intl/locale-data/jsonp/en';

Import some localized strings don't forget put this code in index.js // e.g in your index.js import { // en, // fr, // nl, // de, // pl, // pt, // ar, // ko // fr enGB, registerTranslation, } from 'react-native-paper-dates' // registerTranslation('en', en) // registerTranslation('fr', fr) // registerTranslation('nl', nl) // registerTranslation('pl', pl) // registerTranslation('pt', pt) // registerTranslation('de', de) // registerTranslation('ar', ar) // registerTranslation('ko', ko) // registerTranslation('fr', fr) registerTranslation('en-GB', enGB)

On Wed, Oct 19, 2022 at 6:39 AM Shreyanch @.***> wrote:

I am facing the same issue in Ios Simulator, How can i resolve this issue ?

[image: simulator_screenshot_E398A9F3-A262-4184-903F-DE9B89D56AFB] https://user-images.githubusercontent.com/114562284/196668507-57bb611f-f2c9-4d04-9ab8-e186edf51c8c.png

— Reply to this email directly, view it on GitHub https://github.com/web-ridge/react-native-paper-dates/pull/199#issuecomment-1283795027, or unsubscribe https://github.com/notifications/unsubscribe-auth/APLS6JAC76Y2IIVKZ5E47KLWD7FUZANCNFSM6AAAAAAQJYYFZA . You are receiving this because you commented.Message ID: @.***>

RichardLindhout commented 1 year ago

You should enable hermes on Android and you don't need polyfills for intl at all!