bgregos / foreground

Simple Android personal task manager with Taskwarrior integration
Apache License 2.0
255 stars 16 forks source link

[bug] crash after selecting a date on system using Chinese locale #129

Open pacien opened 3 years ago

pacien commented 3 years ago

As reported by @linsui on gitlab.com/fdroid/fdroiddata!9506:

The apk crashed if I select a date before seleting a time when creating a task.

I tested the apk from GitHub release and it also crashed. I tested on Android 11.

it's because of the system locale. I use Chinese.

08-14 20:28:05.166 16799 16799 E AndroidRuntime: Caused by: java.text.ParseException: Unparseable date: "八月 14, 2021 12:00 AM"
08-14 20:28:05.166 16799 16799 E AndroidRuntime:  at java.text.DateFormat.parse(DateFormat.java:362)

I was able to reproduce the crash by setting the locale to Chinese, in an emulator with Foreground 1.5.1 on Android API 31.