use new Datepicker

This commit is contained in:
Benni Bärmann 2021-01-05 13:01:32 +01:00
parent 1cdc5fb4d2
commit 82ab5f4eae
2 changed files with 6 additions and 8 deletions

View File

@ -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'}),}

View File

@ -1,8 +1,5 @@
{% load i18n %}
{% load static %}
<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="{% static 'admin/js/core.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.js' %}"></script>
@ -13,7 +10,9 @@
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/base.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/widgets.css' %}" />
{% load i18n %}
{% block content %}
<center>
<style>
ul > li {
@ -40,5 +39,4 @@
</table>
<button type="submit" value="submit">Abschicken</button>
</form>
</center>
{% endblock %}
</center>{% endblock %}