Merge branch 'main' into release
This commit is contained in:
commit
5663822e0c
@ -217,8 +217,7 @@ func api_builder() {
|
|||||||
year_result.Unit = DISTANCE_UNIT
|
year_result.Unit = DISTANCE_UNIT
|
||||||
if distances[i].StartTime.Year() == time.Now().Year() {
|
if distances[i].StartTime.Year() == time.Now().Year() {
|
||||||
elapsed_days := time.Now().YearDay()
|
elapsed_days := time.Now().YearDay()
|
||||||
relation := float64(elapsed_days) * 100 / 365
|
year_result.Value = roundFloat(year_distance.Value*365/float64(elapsed_days), 2)
|
||||||
year_result.Value = roundFloat(year_distance.Value*relation, 2)
|
|
||||||
} else {
|
} else {
|
||||||
year_result = year_distance
|
year_result = year_distance
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user