Compare commits

..

1 Commits

Author SHA1 Message Date
Alf Sebastian Houge
20a1421576 Calculate mileage on odometer order instead of time 2022-03-15 14:26:46 +01:00
4 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package service
import (
"sort"
"time"
"github.com/akhilrex/hammond/db"
@@ -15,6 +16,9 @@ func GetMileageByVehicleId(vehicleId string, since time.Time) (mileage []models.
fillups := make([]db.Fillup, len(*data))
copy(fillups, *data)
sort.Slice(fillups, func(i, j int) bool {
return fillups[i].OdoReading > fillups[j].OdoReading
})
var mileages []models.MileageModel

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 463 B

View File

@@ -5,7 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="shortcut icon" href="<%= webpackConfig.output.publicPath %>hammond.png" />
<link rel="apple-touch-icon" href="<%= webpackConfig.output.publicPath %>touch-icon.png" />
<title><%= webpackConfig.name %></title>
</head>
<body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB