Private
Public Access
1
0

date, time in local time

This commit is contained in:
Sander Roosendaal
2017-09-21 21:14:12 +02:00
parent 79d2c7490a
commit e54d914b14
2 changed files with 11 additions and 9 deletions

View File

@@ -1,7 +1,9 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load staticfiles %} {% load staticfiles %}
{% load rowerfilters %} {% load rowerfilters %}
{% load tz %}
{% get_current_timezone as TIME_ZONE %}
{% load l10n %}
{% block title %}Workouts{% endblock %} {% block title %}Workouts{% endblock %}
{% block content %} {% block content %}
@@ -51,8 +53,7 @@
<table width="100%" class="listtable shortpadded"> <table width="100%" class="listtable shortpadded">
<thead> <thead>
<tr> <tr>
<th style="width:80px"> Date</th> <th style="width:120px"> Date, Time</th>
<th> Time</th>
<th> Name</th> <th> Name</th>
<th> Type</th> <th> Type</th>
<th> Distance </th> <th> Distance </th>
@@ -76,8 +77,9 @@
{% else %} {% else %}
<tr> <tr>
{% endif %} {% endif %}
<td> {{ workout.date |truncatechars:15}} </td> {% localtime on %}
<td> {{ workout.starttime }} </td> <td> {{ workout.startdatetime|localtime|date:"Y-m-d, H:i" }} </td>
{% endlocaltime %}
<td> <td>
{% if workout.user.user == user or user == team.manager %} {% if workout.user.user == user or user == team.manager %}
{% if workout.rankingpiece %} {% if workout.rankingpiece %}

View File

@@ -4341,17 +4341,17 @@ def workouts_view(request,message='',successmessage='',
if theteam.viewing == 'allmembers' or theteam.manager == request.user: if theteam.viewing == 'allmembers' or theteam.manager == request.user:
workouts = Workout.objects.filter(team=theteam, workouts = Workout.objects.filter(team=theteam,
startdatetime__gte=startdate, startdatetime__gte=startdate,
startdatetime__lte=enddate).order_by("-date", "-starttime") startdatetime__lte=enddate).order_by("-startdatetime")
g_workouts = Workout.objects.filter(team=theteam, g_workouts = Workout.objects.filter(team=theteam,
startdatetime__gte=activity_startdate, startdatetime__gte=activity_startdate,
startdatetime__lte=activity_enddate).order_by("-date", "-starttime") startdatetime__lte=activity_enddate).order_by("-date", "-starttime")
elif theteam.viewing == 'coachonly': elif theteam.viewing == 'coachonly':
workouts = Workout.objects.filter(team=theteam,user=r, workouts = Workout.objects.filter(team=theteam,user=r,
startdatetime__gte=startdate, startdatetime__gte=startdate,
startdatetime__lte=enddate).order_by("-date","-starttime") startdatetime__lte=enddate).order_by("-startdatetime")
g_workouts = Workout.objects.filter(team=theteam,user=r, g_workouts = Workout.objects.filter(team=theteam,user=r,
startdatetime__gte=activity_startdate, startdatetime__gte=activity_startdate,
enddatetime__lte=activity_enddate).order_by("-date","-starttime") enddatetime__lte=activity_enddate).order_by("-startdatetime")
else: else:
@@ -4361,7 +4361,7 @@ def workouts_view(request,message='',successmessage='',
startdatetime__lte=enddate).order_by("-date", "-starttime") startdatetime__lte=enddate).order_by("-date", "-starttime")
g_workouts = Workout.objects.filter(user=r, g_workouts = Workout.objects.filter(user=r,
startdatetime__gte=activity_startdate, startdatetime__gte=activity_startdate,
startdatetime__lte=activity_enddate).order_by("-date","-starttime") startdatetime__lte=activity_enddate).order_by("-startdatetime")
query = request.GET.get('q') query = request.GET.get('q')
if query: if query: