Merge pull request #9232 from osmandapp/Fix_7795

Fix #7795
This commit is contained in:
vshcherb 2020-06-15 13:03:08 +02:00 committed by GitHub
commit 7f9392c610
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -214,10 +214,10 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
if (!data.get(f).isEmpty()) { if (!data.get(f).isEmpty()) {
WptPt pt = data.get(f).findPointToShow(); WptPt pt = data.get(f).findPointToShow();
String fileName = f + "_" + new SimpleDateFormat("HH-mm_EEE", Locale.US).format(new Date(pt.time)); //$NON-NLS-1$ String fileName = f + "_" + new SimpleDateFormat("HH-mm_EEE", Locale.US).format(new Date(pt.time)); //$NON-NLS-1$
Integer track_storage_directory = ctx.getSettings().TRACK_STORAGE_DIRECTORY.get(); Integer trackStorageDirectory = ctx.getSettings().TRACK_STORAGE_DIRECTORY.get();
if (track_storage_directory != OsmandSettings.REC_DIRECTORY) { if (!OsmandSettings.REC_DIRECTORY.equals(trackStorageDirectory)) {
SimpleDateFormat dateDirFormat = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat dateDirFormat = new SimpleDateFormat("yyyy-MM", Locale.US);
// if (track_storage_directory == OsmandSettings.DAILY_DIRECTORY) { // if (trackStorageDirectory == OsmandSettings.DAILY_DIRECTORY) {
// dateDirFormat = new SimpleDateFormat("yyyy-MM-dd"); // dateDirFormat = new SimpleDateFormat("yyyy-MM-dd");
// } // }
String dateDirName = dateDirFormat.format(new Date(pt.time)); String dateDirName = dateDirFormat.format(new Date(pt.time));
@ -369,7 +369,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
if(!newInterval) { if(!newInterval) {
segment.points.add(pt); segment.points.add(pt);
} }
String date = DateFormat.format("yyyy-MM-dd", time).toString(); //$NON-NLS-1$ String date = new SimpleDateFormat("yyyy-MM-dd", Locale.US).format(new Date(time));; //$NON-NLS-1$
if (dataTracks.containsKey(date)) { if (dataTracks.containsKey(date)) {
GPXFile gpx = dataTracks.get(date); GPXFile gpx = dataTracks.get(date);
gpx.tracks.add(track); gpx.tracks.add(track);