fix time input handling

This commit is contained in:
vcoppe
2025-11-16 12:13:55 +01:00
parent 49d8143cc6
commit 36b66100f9

View File

@@ -38,7 +38,7 @@
let endTime: string | undefined = $state(undefined); let endTime: string | undefined = $state(undefined);
let movingTime: number | undefined = $state(undefined); let movingTime: number | undefined = $state(undefined);
let speed: number | undefined = $state(undefined); let speed: number | undefined = $state(undefined);
let artificial = $state(false); let artificial = $state(true);
function toCalendarDate(date: Date): CalendarDate { function toCalendarDate(date: Date): CalendarDate {
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate()); return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
@@ -346,7 +346,7 @@
let fileId = item.getFileId(); let fileId = item.getFileId();
fileActionManager.applyToFile(fileId, (file) => { fileActionManager.applyToFile(fileId, (file) => {
if (item instanceof ListFileItem) { if (item instanceof ListFileItem) {
if (artificial || !$gpxStatistics.global.time.moving) { if (artificial && !$gpxStatistics.global.time.moving) {
file.createArtificialTimestamps( file.createArtificialTimestamps(
getDate(startDate!, startTime!), getDate(startDate!, startTime!),
movingTime! movingTime!
@@ -359,7 +359,7 @@
); );
} }
} else if (item instanceof ListTrackItem) { } else if (item instanceof ListTrackItem) {
if (artificial || !$gpxStatistics.global.time.moving) { if (artificial && !$gpxStatistics.global.time.moving) {
file.createArtificialTimestamps( file.createArtificialTimestamps(
getDate(startDate!, startTime!), getDate(startDate!, startTime!),
movingTime!, movingTime!,
@@ -374,7 +374,7 @@
); );
} }
} else if (item instanceof ListTrackSegmentItem) { } else if (item instanceof ListTrackSegmentItem) {
if (artificial || !$gpxStatistics.global.time.moving) { if (artificial && !$gpxStatistics.global.time.moving) {
file.createArtificialTimestamps( file.createArtificialTimestamps(
getDate(startDate!, startTime!), getDate(startDate!, startTime!),
movingTime!, movingTime!,