Skip to content
Snippets Groups Projects
Commit b5847bc9 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

list of appointments is sorted by date, calendar is limited to

appointments from month before to undefined future
parent 0d8010c9
No related branches found
No related tags found
1 merge request!1Appointments dev
......@@ -88,7 +88,7 @@
{{ type.code }},
{% endfor %}
</td>
<td>{{ approach.datetime_when | date:"d-M-Y H:i" }}</td>
<td>{{ approach.datetime_when | date:"Y-m-d H:i" }}</td>
<td>
<a href="{% url 'web.views.appointment_edit' approach.id %}" type="button" class="btn btn-block btn-default">Details</a>
</td>
......@@ -127,6 +127,7 @@
"lengthChange": false,
"searching": true,
"ordering": true,
"order": [[ 2, "asc"]],
"info": true,
"autoWidth": false
});
......
......@@ -324,8 +324,9 @@ def appointments(request):
today = datetime.datetime.now()
today_midnight = datetime.datetime(today.year,today.month,today.day)
month_ago = today +datetime.timedelta(days=-31)
approaching_list = Appointment.objects.filter(datetime_when__gt = today_midnight, is_finished = False).order_by('datetime_when')
full_list = Appointment.objects.all()
full_list = Appointment.objects.filter(datetime_when__gt = month_ago, is_finished = False).order_by('datetime_when')
for plan in planning_list:
......@@ -346,7 +347,10 @@ def appointment_details(request, id):
def appointment_add(request, id):
full_list = Appointment.objects.all()
today = datetime.datetime.now()
today_midnight = datetime.datetime(today.year,today.month,today.day)
month_ago = today +datetime.timedelta(days=-31)
full_list = Appointment.objects.filter(datetime_when__gt = month_ago, is_finished = False).order_by('datetime_when')
if request.method == 'POST':
form = AppointmentAddForm(request.POST, request.FILES)
form.fields['visit'].widget = forms.HiddenInput()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment