Merge branch 'release/v13.40'
This commit is contained in:
@@ -749,8 +749,32 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
|||||||
|
|
||||||
return datadf
|
return datadf
|
||||||
|
|
||||||
def getpartofday(dt):
|
def getpartofday(row,r):
|
||||||
h = dt.hour
|
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:
|
if h < 12:
|
||||||
return "Morning"
|
return "Morning"
|
||||||
elif h < 18:
|
elif h < 18:
|
||||||
@@ -1169,7 +1193,8 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
|
|
||||||
if title is None or title == '':
|
if title is None or title == '':
|
||||||
title = 'Workout'
|
title = 'Workout'
|
||||||
partofday = getpartofday(row.rowdatetime)
|
partofday = getpartofday(row,r)
|
||||||
|
|
||||||
|
|
||||||
if partofday is not None:
|
if partofday is not None:
|
||||||
title = '{partofday} workout {workouttype}'.format(
|
title = '{partofday} workout {workouttype}'.format(
|
||||||
|
|||||||
@@ -19,6 +19,13 @@
|
|||||||
<input type="submit" value="Save">
|
<input type="submit" value="Save">
|
||||||
</form>
|
</form>
|
||||||
</p>
|
</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>
|
<p>
|
||||||
Garmin Connnect has no manual sync, so connecting your account to your Garmin account will
|
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).
|
automatically auto-sync workouts from Garmin to Rowsandall (but not in the other direction).
|
||||||
|
|||||||
Reference in New Issue
Block a user