mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-12 03:34:09 +02:00
set default export database name to yyyy-MM-dd_DATABASENAME.db, see issue #285
This commit is contained in:
@@ -28,8 +28,9 @@ import com.health.openscale.core.OpenScale;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.DateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
@@ -95,7 +96,8 @@ public class AlarmBackupHandler
|
|||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
|
||||||
if (!prefs.getBoolean("overwriteBackup", false)) {
|
if (!prefs.getBoolean("overwriteBackup", false)) {
|
||||||
databaseName = DateFormat.getDateInstance(DateFormat.SHORT).format(new Date()) + "_" + databaseName;
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
||||||
|
databaseName = dateFormat.format(new Date()) + "_" + databaseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
File exportFile = new File(exportDir, databaseName);
|
File exportFile = new File(exportDir, databaseName);
|
||||||
|
Reference in New Issue
Block a user