Reputation: 7937
I'm using joda-time 1.6.2 in an Android app and I am getting some crash reports
java.lang.IllegalArgumentException: Invalid format: "8:00 AM" is malformed at "AM"
And the code that triggers is is the following:
DateTimeFormatter formatter = DateTimeFormat.forPattern("hh:mm a");
LocalTime lt = formatter.parseDateTime(value).toLocalTime();
I can't reproduce this crash on my phones so it happens only on certain Android devices and I have no clue why.
Upvotes: 3
Views: 416
Reputation: 235
I was faced with the same issue after the release of Android 5. Only devices running this version would crash.
This is probably a localization issue. It appears that your default local does not know the "AM"-string, but something else.
See my post for details and my solution
Upvotes: 2