{#if $velocityUnits === 'speed'} {i18n._('quantities.speed')} {:else} {i18n._('quantities.pace')} {/if}
{#if $velocityUnits === 'speed'}
{#if $distanceUnits === 'imperial'} {i18n._('units.miles_per_hour')} {:else if $distanceUnits === 'metric'} {i18n._('units.kilometers_per_hour')} {:else if $distanceUnits === 'nautical'} {i18n._('units.knots')} {/if}
{:else}
{#if $distanceUnits === 'imperial'} {i18n._('units.minutes_per_mile')} {:else if $distanceUnits === 'metric'} {i18n._('units.minutes_per_kilometer')} {:else if $distanceUnits === 'nautical'} {i18n._('units.minutes_per_nautical_mile')} {/if}
{/if}
{i18n._('toolbar.time.total_time')}
{i18n._('toolbar.time.start')}
{ await tick(); updateEnd(); }} />
{i18n._('toolbar.time.end')}
{ await tick(); updateStart(); }} />
{#if $gpxStatistics.global.time.moving === 0 || $gpxStatistics.global.time.moving === undefined}
{i18n._('toolbar.time.artificial')}
{/if}
{ let effectiveSpeed = getSpeed(); if ( startDate === undefined || startTime === undefined || effectiveSpeed === undefined ) { return; } if (Math.abs(effectiveSpeed - $gpxStatistics.global.speed.moving) < 0.01) { effectiveSpeed = $gpxStatistics.global.speed.moving; } let ratio = 1; if ( $gpxStatistics.global.speed.moving > 0 && $gpxStatistics.global.speed.moving !== effectiveSpeed ) { ratio = $gpxStatistics.global.speed.moving / effectiveSpeed; } let item = $selection.getSelected()[0]; let fileId = item.getFileId(); dbUtils.applyToFile(fileId, (file) => { if (item instanceof ListFileItem) { if (artificial || !$gpxStatistics.global.time.moving) { file.createArtificialTimestamps( getDate(startDate, startTime), movingTime ); } else { file.changeTimestamps( getDate(startDate, startTime), effectiveSpeed, ratio ); } } else if (item instanceof ListTrackItem) { if (artificial || !$gpxStatistics.global.time.moving) { file.createArtificialTimestamps( getDate(startDate, startTime), movingTime, item.getTrackIndex() ); } else { file.changeTimestamps( getDate(startDate, startTime), effectiveSpeed, ratio, item.getTrackIndex() ); } } else if (item instanceof ListTrackSegmentItem) { if (artificial || !$gpxStatistics.global.time.moving) { file.createArtificialTimestamps( getDate(startDate, startTime), movingTime, item.getTrackIndex(), item.getSegmentIndex() ); } else { file.changeTimestamps( getDate(startDate, startTime), effectiveSpeed, ratio, item.getTrackIndex(), item.getSegmentIndex() ); } } }); }} >
{i18n._('toolbar.time.update')}
{#if canUpdate} {i18n._('toolbar.time.help')} {:else} {i18n._('toolbar.time.help_invalid_selection')} {/if}