mirror of
https://github.com/pretix/pretix.git
synced 2026-08-24 13:02:00 +00:00
Added datepicker support in JavaScript
This commit is contained in:
@@ -33,6 +33,7 @@ def contextprocessor(request):
|
|||||||
ctx['nav_event'] = _nav_event
|
ctx['nav_event'] = _nav_event
|
||||||
|
|
||||||
ctx['js_datetime_format'] = get_javascript_format('DATETIME_INPUT_FORMATS')
|
ctx['js_datetime_format'] = get_javascript_format('DATETIME_INPUT_FORMATS')
|
||||||
|
ctx['js_date_format'] = get_javascript_format('DATE_INPUT_FORMATS')
|
||||||
ctx['js_locale'] = get_moment_locale()
|
ctx['js_locale'] = get_moment_locale()
|
||||||
|
|
||||||
return ctx
|
return ctx
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" href="{% static "pretixbase/img/favicon.ico" %}">
|
<link rel="icon" href="{% static "pretixbase/img/favicon.ico" %}">
|
||||||
</head>
|
</head>
|
||||||
<body data-datetimeformat="{{ js_datetime_format }}" data-datetimelocale={{ js_locale }}>
|
<body data-datetimeformat="{{ js_datetime_format }}" data-dateformat="{{ js_date_format }}" data-datetimelocale="{{ js_locale }}">
|
||||||
<div id="#wrapper">
|
<div id="#wrapper">
|
||||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
|
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
|
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
|
||||||
|
|
||||||
$(".datetimepicker").each(function() {
|
$(".datetimepicker").each(function() {
|
||||||
$(this).datetimepicker({
|
$(this).datetimepicker({
|
||||||
format: $("body").attr("data-datetimeformat"),
|
format: $("body").attr("data-datetimeformat"),
|
||||||
@@ -124,6 +124,26 @@ $(function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".datepickerfield").each(function() {
|
||||||
|
$(this).datetimepicker({
|
||||||
|
format: $("body").attr("data-dateformat"),
|
||||||
|
locale: $("body").attr("data-datetimelocale"),
|
||||||
|
useCurrent: false,
|
||||||
|
showClear: !$(this).prop("required"),
|
||||||
|
icons: {
|
||||||
|
time: 'fa fa-clock-o',
|
||||||
|
date: 'fa fa-calendar',
|
||||||
|
up: 'fa fa-chevron-up',
|
||||||
|
down: 'fa fa-chevron-down',
|
||||||
|
previous: 'fa fa-chevron-left',
|
||||||
|
next: 'fa fa-chevron-right',
|
||||||
|
today: 'fa fa-screenshot',
|
||||||
|
clear: 'fa fa-trash',
|
||||||
|
close: 'fa fa-remove'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(".qrcode-canvas").each(function() {
|
$(".qrcode-canvas").each(function() {
|
||||||
$(this).qrcode(
|
$(this).qrcode(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user