Skip to content

Commit

Permalink
Merge pull request #177 from vsimakhin/fix/round-time-error-for-total…
Browse files Browse the repository at this point in the history
…s-table

fix round time error
  • Loading branch information
vsimakhin authored Jan 15, 2024
2 parents 1737817 + 475a7cc commit fab91e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [Unreleased]

- Fix: time error for totals on the main `Logbook page` due to `round` function. Calculation didn't affect Stats or Logbook exports

## [2.29.0] - 15.01.2024

- New: Additional sources for the airport databases. The new option added is from [https://ourairports.com](https://ourairports.com)
Expand Down
6 changes: 5 additions & 1 deletion cmd/web/templates/common-js.partials.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ wlbCommon = function () {
if (minutes < 10) {
minutes = "0" + minutes;
}
if (minutes === 60) {
hours = hours + 1;
minutes = "00";
}
return hours + ":" + minutes;
}

Expand All @@ -99,7 +103,7 @@ wlbCommon = function () {
var hours = parseInt(hoursMinutes[0], 10);
var minutes = hoursMinutes[1] ? parseInt(hoursMinutes[1], 10) : 0;

return hours + Math.round(minutes / 60 * 100) / 100;
return hours + minutes / 60 ;
}

function escapeHtml(unsafe)
Expand Down

0 comments on commit fab91e7

Please sign in to comment.