Private
Public Access
1
0

Merge branch 'release/v13.40'

This commit is contained in:
Sander Roosendaal
2020-07-12 20:07:20 +02:00
2 changed files with 35 additions and 3 deletions

View File

@@ -749,8 +749,32 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
return datadf
def getpartofday(dt):
h = dt.hour
def getpartofday(row,r):
try:
latavg = row.df[' latitude'].mean()
lonavg = row.df[' longitude'].mean()
tf = TimezoneFinder()
try:
timezone_str = tf.timezone_at(lng=lonavg, lat=latavg)
except ValueError:
timezone_str = 'UTC'
if timezone_str == None:
timezone_str = tf.closest_timezone_at(lng=lonavg,
lat=latavg)
if timezone_str == None:
timezone_str = r.defaulttimezone
try:
workoutstartdatetime = pytz.timezone(timezone_str).localize(
row.rowdatetime
)
except ValueError:
workoutstartdatetime = row.rowdatetime
except KeyError:
timezone_str = r.defaulttimezone
h = workoutstartdatetime.astimezone(pytz.timezone(timezone_str)).hour
if h < 12:
return "Morning"
elif h < 18:
@@ -1169,7 +1193,8 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
if title is None or title == '':
title = 'Workout'
partofday = getpartofday(row.rowdatetime)
partofday = getpartofday(row,r)
if partofday is not None:
title = '{partofday} workout {workouttype}'.format(

View File

@@ -19,6 +19,13 @@
<input type="submit" value="Save">
</form>
</p>
{% if rower.garmintoken and rower.garmintoken != '' %}
<p>
<em>You are connected to Garmin.</em> Switching off Garmin Connect sync is on the
<a href="https://connect.garmin.com/modern/settings/accountInformation">Account settings</a>
page. Look for the "Rowsandall" app.
</p>
{% endif %}
<p>
Garmin Connnect has no manual sync, so connecting your account to your Garmin account will
automatically auto-sync workouts from Garmin to Rowsandall (but not in the other direction).