Skip to content

Commit

Permalink
Merge pull request #244 from hargata/Hargata/deltamileage
Browse files Browse the repository at this point in the history
swap min max label on filter.
  • Loading branch information
hargata authored Feb 7, 2024
2 parents 2b2f181 + 8c3a001 commit 2712663
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Views/Vehicle/_Gas.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<tr class="d-flex" style="cursor:pointer;" onclick="showEditGasRecordModal(@gasRecord.Id)" data-tags='@string.Join(" ", gasRecord.Tags)'>
<td class="col-2">@gasRecord.Date</td>
<td class="col-2" data-gas-type="mileage" data-gas-aggregate="@gasRecord.DeltaMileage" data-gas-original="@gasRecord.Mileage">@gasRecord.Mileage</td>
<td class="col-1">@((hideZero && gasRecord.DeltaMileage == default) ? "---" : @gasRecord.DeltaMileage)</td>
<td class="col-1">@(gasRecord.DeltaMileage == default ? "---" : gasRecord.DeltaMileage)</td>
<td class="col-2" data-gas-type="consumption" data-gas-aggregate="@gasRecord.Gallons">@gasRecord.Gallons.ToString("F")</td>
<td class="col-3" data-gas-type="fueleconomy" data-aggregated='@(gasRecord.IncludeInAverage.ToString().ToLower())'>@(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F"))</td>
<td class="col-1" data-record-type="cost">@((hideZero && gasRecord.Cost == default) ? "---" : gasRecord.Cost.ToString(gasCostFormat))</td>
Expand Down
10 changes: 8 additions & 2 deletions wwwroot/js/gasrecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,14 @@ function updateMPGLabels() {
} else {
averageLabel.text(`${averageLabel.text().split(':')[0]}: 0.00`);
}
minLabel.text(`${minLabel.text().split(':')[0]}: ${minMPG.toFixed(2)}`);
maxLabel.text(`${maxLabel.text().split(':')[0]}: ${maxMPG.toFixed(2)}`);
if (!getGlobalConfig().useMPG && $("[data-gas='fueleconomy']").attr("data-unit") != 'km/l') {
maxLabel.text(`${maxLabel.text().split(':')[0]}: ${minMPG.toFixed(2)}`);
minLabel.text(`${minLabel.text().split(':')[0]}: ${maxMPG.toFixed(2)}`);
}
else {
minLabel.text(`${minLabel.text().split(':')[0]}: ${minMPG.toFixed(2)}`);
maxLabel.text(`${maxLabel.text().split(':')[0]}: ${maxMPG.toFixed(2)}`);
}
}
}

Expand Down

0 comments on commit 2712663

Please sign in to comment.