florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 334 forks source link

Crash if I setDefaultDate to 31 #181

Open Alejan93 opened 6 years ago

Alejan93 commented 6 years ago

If I setDefaultDate with any day that is 31, like 31 october or 31 july the app crash

java.lang.IndexOutOfBoundsException: Index: 30, Size: 30 at java.util.ArrayList.get(ArrayList.java:437) at com.github.florent37.singledateandtimepicker.widget.WheelPicker.setDefaultDate(WheelPicker.java:256) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.setDefaultDate(SingleDateAndTimePicker.java:458) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.onAttachedToWindow(SingleDateAndTimePicker.java:217) at android.view.View.dispatchAttachedToWindow(View.java:17558) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3332) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1792) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1515) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7266) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981) at android.view.Choreographer.doCallbacks(Choreographer.java:790) at android.view.Choreographer.doFrame(Choreographer.java:721) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7425) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) 2018-10-24 15:38:02.473 15624-15624/com.arvum.comunitaas E/UncaughtException: java.lang.IndexOutOfBoundsException: Index: 30, Size: 30 at java.util.ArrayList.get(ArrayList.java:437) at com.github.florent37.singledateandtimepicker.widget.WheelPicker.setDefaultDate(WheelPicker.java:256) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.setDefaultDate(SingleDateAndTimePicker.java:458) at com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker.onAttachedToWindow(SingleDateAndTimePicker.java:217) at android.view.View.dispatchAttachedToWindow(View.java:17558) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3332) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3339) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1792) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1515) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7266) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981) at android.view.Choreographer.doCallbacks(Choreographer.java:790) at android.view.Choreographer.doFrame(Choreographer.java:721) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7425) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Andravind commented 5 years ago

hi any one is working on this i am getting the same issue can u please tell me what i have to do