Instant-Weather icon indicating copy to clipboard operation
Instant-Weather copied to clipboard

Forecast: App closes when click on weekly calendar

Open joseluisq opened this issue 2 years ago • 1 comments

Version: 1.0 Steps to reproduce:

  1. Install the app and open it, then click on bottom menu called Forecast
  2. Now click on whatever day of the top weekly calendar.
  3. The app closes itself.

joseluisq avatar Aug 11 '22 19:08 joseluisq

@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,

  1. 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 this fun WeatherForecast.fromDtoToVo() = this.copy( date = date.formatDate())
  1. Force user save date string in Locale.English.
  • still require db migration.

Kenny50 avatar Sep 28 '22 11:09 Kenny50