react-native-calendars
react-native-calendars copied to clipboard
undefined is not an object (evaluating 'getSetting('monthNames')[getField(MONTH)]')
"react-native": "0.61.0", "react-native-calendars": "^1.265.0",
Same Error, but with 'DAY'.
TypeError: TypeError: undefined is not an object (evaluating 'getSetting('dayNames')[getField(DAY)]')
Solved add dayNames on array ->
LocaleConfig.locales['pt'] = { monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], monthNamesShort: ['Jan.', 'Fev.', 'Mar', 'Abril', 'Mai', 'Jun', 'Jul.', 'Ago', 'Set.', 'Out.', 'Nov.', 'Dez.'], dayNames: ['Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado', 'Domingo'], dayNamesShort: ['Dom.', 'Seg.', 'Ter.', 'Qua.', 'Qui.', 'Sex.', 'Sab.'] };
LocaleConfig.defaultLocale = 'pt';
try add 'LocaleConfig' as above.
same error
Solved add dayNames on array ->
LocaleConfig.locales['pt'] = { monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], monthNamesShort: ['Jan.', 'Fev.', 'Mar', 'Abril', 'Mai', 'Jun', 'Jul.', 'Ago', 'Set.', 'Out.', 'Nov.', 'Dez.'], dayNames: ['Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado', 'Domingo'], dayNamesShort: ['Dom.', 'Seg.', 'Ter.', 'Qua.', 'Qui.', 'Sex.', 'Sab.'] };
LocaleConfig.defaultLocale = 'pt';
try add 'LocaleConfig' as above.
doesn't always help, sometimes i need to change something and save -> it reloads js bundle and then error goes away, weird
Same error
Same error. Even though I removed the LocaleConfig lines, the error still appeared. Why @chenei you close while there haven't been any contribution or solution comments?
Same error. Even though I removed the LocaleConfig lines, the error still appeared. Why @chenei you close while there haven't been any contribution or solution comments?
I closed because I wasn't able to reproduce. reopening.
@BeeTheJason You can try, move the following configuration to App.js:
LocaleConfig.locales['pt'] = {
monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
monthNamesShort: ['Jan.', 'Fev.', 'Mar', 'Abril', 'Mai', 'Jun', 'Jul.', 'Ago', 'Set.', 'Out.', 'Nov.', 'Dez.'],
dayNames: ['Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado', 'Domingo'],
dayNamesShort: ['Dom.', 'Seg.', 'Ter.', 'Qua.', 'Qui.', 'Sex.', 'Sab.']
};
LocaleConfig.defaultLocale = 'pt';
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have the same issue, with these dependencies:
"dependencies": {
"i18next": "^21.9.1",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-i18next": "^11.18.4",
"react-is": "^18.2.0",
"react-native": "0.69.5",
"react-native-calendars": "^1.1275.0",
"react-native-device-info": "^8.7.0",
"react-native-encrypted-storage": "^4.0.2",
"react-native-gesture-handler": "^2.3.0",
"react-native-paper": "^4.12.4",
"react-native-safe-area-context": "^4.1.2",
"react-native-screens": "^3.13.1",
"react-native-vector-icons": "^9.1.0",
"styled-components": "^5.3.5"
},
Worked, with previous react native (0.68.x). Now it seems no more happy.
I have the months/days names in the i18n files and they were working properly (see TKCompanionApp version 3.1.2 on F-Droid. Now I'm preparing the new version, just updated to a newer React Native and that's it. 😢
I'm trying to cleanup everything and rebuild to see if something changes...
I might have got the point. Updating React from 0.68.0 to 0.69.5 seems that the locale changed from simple en
to en-US
and I don't have the en-US.json
file in my i18n list, only en.json
.
It was working till now. 🤷
Well, anyway now I've changed things so that if I have a locale-
country information and I don't have the country-specific i18n file, I'll cut to the language only part and see if available.
Seems working fine in this way.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.