From 82ab5f4eae51e4bd8d421e65b7ca75d39a2ee030 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 5 Jan 2021 13:01:32 +0100 Subject: [PATCH] use new Datepicker --- evapp/forms.py | 6 +++--- evapp/templates/evapp/employee_form.html | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/evapp/forms.py b/evapp/forms.py index c09a6a9..b30bfc4 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -1,6 +1,6 @@ from django.db import models from django.contrib.admin.widgets import AdminDateWidget -from django.forms import ModelForm +from django.forms import ModelForm, DateInput from .models import Employee @@ -8,5 +8,5 @@ class EmployeeForm(ModelForm): class Meta: model = Employee fields = '__all__' - widgets = {'firstdate_employment': AdminDateWidget(), - 'firstdate_presence': AdminDateWidget(),} + widgets = {'firstdate_employment': DateInput(attrs={'type': 'date'}), + 'firstdate_presence': DateInput(attrs={'type': 'date'}),} diff --git a/evapp/templates/evapp/employee_form.html b/evapp/templates/evapp/employee_form.html index 2d5aefd..01cdcd9 100644 --- a/evapp/templates/evapp/employee_form.html +++ b/evapp/templates/evapp/employee_form.html @@ -1,8 +1,5 @@ - -{% load i18n %} {% load static %} - @@ -13,7 +10,9 @@ +{% load i18n %} {% block content %} +