fix
This commit is contained in:
@@ -598,9 +598,9 @@ def polygon_nearest_point(polygon, latitude, longitude,debug=False):
|
||||
points = GeoPoint.objects.filter(polygon=polygon)
|
||||
points = sorted(points, key = lambda p: geo_distance(p.latitude, p.longitude, latitude, longitude))
|
||||
|
||||
if debug:
|
||||
for p in points:
|
||||
print(p,p.latitude, p.longitude, latitude, longitude, geo_distance(p.latitude, p.longitude, latitude, longitude))
|
||||
#if debug:
|
||||
# for p in points:
|
||||
# print(p,p.latitude, p.longitude, latitude, longitude, geo_distance(p.latitude, p.longitude, latitude, longitude))
|
||||
|
||||
return points[0].latitude, points[0].longitude
|
||||
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -2680,9 +2680,10 @@ def history_view(request, userid=0):
|
||||
last28 = timezone.now() - datetime.timedelta(days=28)
|
||||
|
||||
today = timezone.now()
|
||||
lastyear = today - datetime.timedelta(days=365)
|
||||
|
||||
lastyear = datetime.datetime(
|
||||
year=today.year - 1, month=today.month, day=today.day)
|
||||
#lastyear = datetime.datetime(
|
||||
# year=today.year - 1, month=today.month, day=today.day)
|
||||
|
||||
firstmay = datetime.datetime(
|
||||
year=today.year, month=5, day=1).astimezone(usertimezone)
|
||||
|
||||
Reference in New Issue
Block a user