iSoron / uhabits

Loop Habit Tracker, a mobile app for creating and maintaining long-term positive habits
GNU General Public License v3.0
7.89k stars 935 forks source link

Import from habit bull export fails #762

Closed dadatuputi closed 3 years ago

dadatuputi commented 3 years ago

Pre-submission checklist

Description

Importing a newly exported habit bull csv fails

Steps to reproduce

  1. Export habit bull csv
  2. Import into Habits
  3. See error

System information

hiqua commented 3 years ago

Which versions do you use? Habit bull / Loop Habit Tracker?

dadatuputi commented 3 years ago

HabitBull 1.5.15.

hiqua commented 3 years ago

Thanks! If you have a minimal CSV example that fails to be imported that could also speed up the debugging.

dadatuputi commented 3 years ago

Here you go: HabitBullData.zip

hiqua commented 3 years ago

Thanks!

The problem seems to be the date format. In your CSV, it seems to be $month/$day/$year/ instead. Loop Habit Tracker expects $year-$month-$day, and thus fails when it tries to parse the year.

If you switch these manually you should be able to import your habits.

The values -2.15E+09 are also weird, but the code seems to just ignore these values so that should be fine.

iSoron commented 3 years ago

@dadatuputi Thank you for the bug report and for the sample CSV file. They are very helpful.

@hiqua Nice debugging. It looks like they are now generating CSV files according to the user locale. Perhaps we should try both formats (YYYY-MM-DD and current locale).

iSoron commented 3 years ago

Fixed in b58af03a7ce86fd68d497e96ba37ac1d099cfe26. The fix will become available in Loop 2.0.