Commit 22600d37 authored by Bengfort's avatar Bengfort
Browse files

add datepicker polyfill for safari

parent 69439b3e
Pipeline #7720 passed with stages
in 2 minutes and 53 seconds
......@@ -2,6 +2,8 @@
"name": "scheduler",
"version": "1.0.0",
"dependencies": {
"bootstrap": "^4.5.3"
"bootstrap": "^4.5.3",
"bootstrap-datepicker": "^1.9.0",
"jquery": "^3.5.1"
}
}
......@@ -144,4 +144,17 @@
th.textContent = formatDate(tr.dataset.value) + ' ';
th.append(createDeleteButton(rmRow));
}
document.querySelectorAll('[type="date"]').forEach(function(e) {
if (e.type !== 'date') {
$(e).datepicker({
format: 'yyyy-mm-dd',
language: document.documentElement.lang,
autoclose: true,
calendarWeeks: true,
daysOfWeekHighlighted: '0,6',
todayHighlight: true,
});
}
});
})();
......@@ -9,6 +9,7 @@
<title>{% block title %}{{ TITEL }}{% endblock %}</title>
<link rel="shortcut icon" type="image/x-icon" href="{% static 'images/favicon.ico' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'bootstrap/dist/css/bootstrap.min.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css' %}" />
</head>
<body>
<header class="bg-dark">
......@@ -38,6 +39,9 @@
</main>
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
<script src="{% static 'jquery/dist/jquery.min.js' %}"></script>
<script src="{% static 'bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' %}"></script>
<script src="{% static 'bootstrap-datepicker/dist/locales/bootstrap-datepicker.de.min.js' %}"></script>
{% block extra_scripts %}{% endblock %}
</body>
</html>
......@@ -111,6 +111,12 @@ NPM_FILE_PATTERNS = {
'bootstrap': [
'dist/css/bootstrap.min.css',
],
'bootstrap-datepicker': [
'dist/css/bootstrap-datepicker3.min.css',
'dist/js/bootstrap-datepicker.min.js',
'dist/locales/bootstrap-datepicker.de.min.js',
],
'jquery': ['dist/jquery.min.js'],
}
BOOTSTRAP4 = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment