Open vinayzerozilla opened 8 months ago
Got the same issue
I have same issue !
found this:
https://web-ridge.github.io/react-native-paper-dates/docs/intro
Scroll down to Custom, you can register your own locale, seems like a workaround. With this it worked for me.
Can you explain more about the way to fix the warning
I just registered my preferred language at the "Custom" part in https://web-ridge.github.io/react-native-paper-dates/docs/intro.
Like:
import { registerTranslation } from 'react-native-paper-dates'
registerTranslation('pl', {
save: 'Save',
selectSingle: 'Select date',
selectMultiple: 'Select dates',
selectRange: 'Select period',
notAccordingToDateFormat: (inputFormat) =>
`Date format must be ${inputFormat}`,
mustBeHigherThan: (date) => `Must be later then ${date}`,
mustBeLowerThan: (date) => `Must be earlier then ${date}`,
mustBeBetween: (startDate, endDate) =>
`Must be between ${startDate} - ${endDate}`,
dateIsDisabled: 'Day is not allowed',
previous: 'Previous',
next: 'Next',
typeInDate: 'Type in date',
pickDateFromCalendar: 'Pick date from calendar',
close: 'Close',
})
And here i just added my own translation.
I'm really happy because I successfully resolved the issue that was causing a warning. It feels great to have everything working smoothly now. Thanks so much for your help!
I think the problem stems from the documentation using en-gb as an example.
Replacing registerTranslation("en-GB", enGB);
with registerTranslation("en", enGB);
fixes the problem for me and doesnt require you to implement your own custom localisation.
Issue
Giving the warning [react-native-paper-dates] The locale en is not registered, see README!, key: typeInDate
Expected Behavior
it shouldn't give warning after the setting the locale also
Code
Environment
react-native -v
: 0.72.4node -v
: v18.18.0npm -v
: 9.8.1yarn --version
:target platform
: Android | iOS : Androidoperating system
: Windows