Instant-Weather
Instant-Weather copied to clipboard
Forecast: App closes when click on weekly calendar
Version: 1.0 Steps to reproduce:
- Install the app and open it, then click on bottom menu called Forecast
- Now click on whatever day of the top weekly calendar.
- The app closes itself.
@mayokunadeniyi
This issue caused by date format, date string will format to Locale.getDefault() before save into db, but the parsing after reading id Locale.ENGLISH, changing the parsing after reading will cause error if user change system language
I came up with following solution,
- Save clean date format, then parse it after read it from db
- demo
- This require update code in multiple place, including test and db migration.
- update --
fromDtoToVo()
will be better to thisfun WeatherForecast.fromDtoToVo() = this.copy( date = date.formatDate())
- Force user save date string in Locale.English.
- still require db migration.