kochka / WeightLogger

WeightLogger Android app
Other
69 stars 23 forks source link

All entries are saved as January 1, 1970 #61

Closed wary-hermit closed 3 years ago

wary-hermit commented 3 years ago

New saved entries in list show that they're created at January 1, 1970, even if during information entry stage normal date is selected.
Restoring "good" database from backup also makes all entries January 1, 1970.

wary-hermit commented 3 years ago

This seems to be the issue with my database backups.
After I clear all cache - dates are now being saved fine. When I import my backups - all imported entries are from year 1970, and new entries are also saved this way. Probably my backups are incompatible and cause problems, since I was using my forked version (I was saving "Visceral fat rating" as floats, since my scales show value with a point). Gonna just ignore my backups and start logging from beginning. Closing issue.

kochka commented 3 years ago

Hello, sorry but I didn't had time to investigate in this. You can check your backup files as it is just a copy of the SQLite database file, so you can edit it with a SQLite editor.

wary-hermit commented 3 years ago

Hello, sorry but I didn't had time to investigate in this. You can check your backup files as it is just a copy of the SQLite database file, so you can edit it with a SQLite editor.

Thanks! Found my problem.. I wanted to implement option to choose between "Visceral fat rating" and "Visceral fat percentage", similar like with Muscle percentage/weight (although it seems they're the same, but for some reason my scale calls it this way and shows real number, instead of integer) - but was failing to do that - so I just added "Visceral fat percentage" as float which I saved in database in separate field and changed UI to show that instead of Visceral fat rating. It's been a while and I've lost my code, so I didn't even remember that. But Garmin as always breaks stuff, so I had to switch back to original version.

Probably that's why app freaks out now, when I import my backup, my bad 😄 And it turns out I can just edit database and manually insert my entries (just have to change field and switch integers), so thats great news!