adding time and dsitance
This commit is contained in:
@@ -179,9 +179,11 @@
|
|||||||
{{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
|
{{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ workout.distance }}m
|
<span style="color:#555">Distance</span><br>
|
||||||
|
{{ workout.distance|distanceprint }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<span style="color:#555">Time</span><br>
|
||||||
{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
|
{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -375,6 +375,14 @@ def ddays(ddelta):
|
|||||||
def spacetohtml(t):
|
def spacetohtml(t):
|
||||||
return t.replace(" ","%20")
|
return t.replace(" ","%20")
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def distanceprint(d):
|
||||||
|
if d<10000:
|
||||||
|
return "{d} m".format(d=d)
|
||||||
|
|
||||||
|
d2 = d/1000.
|
||||||
|
return "%.2f km" % d2
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def durationprint(d,dstring):
|
def durationprint(d,dstring):
|
||||||
if (d == None): # pragma: no cover
|
if (d == None): # pragma: no cover
|
||||||
|
|||||||
Reference in New Issue
Block a user