henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.25k stars 345 forks source link

NPE for "eu-ES" locale #202

Closed mars-lan closed 4 years ago

mars-lan commented 4 years ago

Describe the bug NPE is thrown when the default locale is set to "eu-ES" (Basque in Spain). This is due to the getFormatPattern returning null.

Similar to https://github.com/henninghall/react-native-date-picker/issues/150, the locale pattern for this language is also a bit funky: y('e')'ko' MMMM'ren' d('a'), EEEE. This breaks many of the assumptions made in LocaleUtils and leads to tge failure of extracting the "year" part from the pattern.

Expected behavior No NPE thrown

To Reproduce Set locale to "eu-ES" - Euskara (Espania)

Smartphone (please complete the following information):

henninghall commented 4 years ago

Thanks for reporting this! Fixed by https://github.com/henninghall/react-native-date-picker/pull/204 and released in v3.0.1