Private
Public Access
1
0

Fixed some time rendering bugs

This commit is contained in:
sanderroosendaal
2016-10-31 17:29:30 +01:00
parent faf23c3162
commit 17a7e236b8
13 changed files with 22956 additions and 9 deletions

View File

@@ -71,16 +71,27 @@ def tailwind(bearing,vwind,winddir):
def niceformat(values):
out = []
for v in values:
formattedv = v.strftime("%H:%M:%S")
formattedv = strfdelta(v)
out.append(formattedv)
return out
def strfdelta(tdelta):
minutes,seconds = divmod(tdelta.seconds,60)
tenths = int(tdelta.microseconds/1e5)
res = "{minutes:0>2}:{seconds:0>2}.{tenths:0>1}".format(
minutes=minutes,
seconds=seconds,
tenths=tenths,
)
return res
def nicepaceformat(values):
out = []
for v in values:
formattedv = v.strftime("%M:%S.%f")
out.append(formattedv[:-5])
formattedv = strfdelta(v)
out.append(formattedv)
return out
@@ -952,8 +963,8 @@ def interactive_cum_flex_chart(theworkouts,promember=0,
plot.x_range = xrange1
if xparam == 'time':
xrange1 = Range1d(start=xaxmin,end=xaxmax)
plot.x_range = xrange1
#xrange1 = Range1d(start=xaxmin,end=xaxmax)
#plot.x_range = xrange1
plot.xaxis[0].formatter = DatetimeTickFormatter(
hours = ["%H"],
minutes = ["%M"],
@@ -1372,8 +1383,8 @@ def interactive_flex_chart(id=0,promember=0,
plot.x_range = xrange1
if xparam == 'time':
xrange1 = Range1d(start=xaxmin,end=xaxmax)
plot.x_range = xrange1
#xrange1 = Range1d(start=xaxmin,end=xaxmax)
#plot.x_range = xrange1
plot.xaxis[0].formatter = DatetimeTickFormatter(
hours = ["%H"],
minutes = ["%M"],
@@ -1717,8 +1728,8 @@ def interactive_flex_chart2(id=0,promember=0,
plot.x_range = xrange1
if xparam == 'time':
xrange1 = Range1d(start=xaxmin,end=xaxmax)
plot.x_range = xrange1
#xrange1 = Range1d(start=xaxmin,end=xaxmax)
#plot.x_range = xrange1
plot.xaxis[0].formatter = DatetimeTickFormatter(
hours = ["%H"],
minutes = ["%M"],