Private
Public Access
1
0
This commit is contained in:
2024-02-29 10:43:56 +01:00
parent d07b20eb29
commit 4fd98fbbab
3 changed files with 6 additions and 5 deletions

View File

@@ -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

Binary file not shown.

View File

@@ -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)