savvisingh / DateRangePicker

Date Range Picker is a Calendar Picker View to show a Customized Date Range Picker with improved UI and functionality to add subtitles to the dates
Apache License 2.0
784 stars 160 forks source link

java.lang.IllegalArgumentException Unknown pattern character 'Y' #25

Closed iffanmajid closed 6 years ago

iffanmajid commented 6 years ago

Did anyone facing this kind of issue? Caused by java.lang.IllegalArgumentException: Unknown pattern character 'Y' at java.text.SimpleDateFormat.validatePatternCharacter(SimpleDateFormat.java:323) at java.text.SimpleDateFormat.validatePattern(SimpleDateFormat.java:312) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:365)

reproduced in xiaomi redmi note 3, android 6.0.1.

here's my initialization in kotlin: date_range.init(currentTime.time, nextYear.time, SimpleDateFormat("MMMM, YYYY", Locale.getDefault()))

Solved with change year on date format to lower: date_range.init(currentTime.time, nextYear.time, SimpleDateFormat("MMMM, yyyy", Locale.getDefault()))