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 346 forks source link

Wheel.java IllegalArgumentException: Illegal pattern character 'e' #194

Closed draperunner closed 4 years ago

draperunner commented 4 years ago

Describe the bug We see a bunch of crashes in Crashlytics due to Illegal pattern character 'e' and some Illegal pattern character 'g'.

Here's the stack trace:

Fatal Exception: java.lang.IllegalArgumentException: Illegal pattern character 'e'
       at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:870)
       at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:684)
       at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:623)
       at com.henninghall.date_picker.wheels.Wheel.<init>(Wheel.java:35)
       at com.henninghall.date_picker.wheels.DateWheel.<init>(DateWheel.java:14)
       at com.henninghall.date_picker.ui.Wheels.<init>(Wheels.java:52)
       at com.henninghall.date_picker.ui.UIManager.<init>(UIManager.java:27)
       at com.henninghall.date_picker.PickerView.<init>(PickerView.java:27)
       at com.henninghall.date_picker.DatePickerManager.createViewInstance(DatePickerManager.java:40)
       at com.henninghall.date_picker.DatePickerManager.createViewInstance(DatePickerManager.java:25)
       at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
       at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:270)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:180)
       at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:786)
       at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:903)
       at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:43)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:963)
       at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:964)
       at android.view.Choreographer.doCallbacks(Choreographer.java:778)
       at android.view.Choreographer.doFrame(Choreographer.java:710)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:251)
       at android.app.ActivityThread.main(ActivityThread.java:6589)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

It happens on a variety of different models:

image

Expected behavior No crashes.

To Reproduce

I haven't been able to reproduce it myself yet. There are three available locales : 'en', 'nb' and 'nn' that we pass to the locale prop of `DatePicker.

Smartphone (please complete the following information):

henninghall commented 4 years ago

Thanks a lot, I will look into it!

draperunner commented 4 years ago

I was just able to reproduce it on a Samsung simulator. It crashes when the system language is set to Danish. English works fine. We are using the locale prop to override the system language, but it crashes anyways.

henninghall commented 4 years ago

Released the fix for this in 2.7.11