mirror of
https://github.com/pretix/pretix.git
synced 2025-12-14 13:32:28 +00:00
Compare commits
7 Commits
enqueue-or
...
fix-datepi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a290e96f74 | ||
|
|
dca3ab8395 | ||
|
|
8292ff0e2b | ||
|
|
8c3880174e | ||
|
|
5a51a1105e | ||
|
|
10477785c3 | ||
|
|
2819c66426 |
@@ -196,7 +196,15 @@ var form_handlers = function (el) {
|
|||||||
}
|
}
|
||||||
if ($(this).is('[data-is-payment-date]'))
|
if ($(this).is('[data-is-payment-date]'))
|
||||||
opts["daysOfWeekDisabled"] = JSON.parse($("body").attr("data-payment-weekdays-disabled"));
|
opts["daysOfWeekDisabled"] = JSON.parse($("body").attr("data-payment-weekdays-disabled"));
|
||||||
$(this).datetimepicker(opts);
|
$(this).datetimepicker(opts).on("dp.hide", function() {
|
||||||
|
// when min/max is used in datetimepicker, closing and re-opening the picker opens at the wrong date
|
||||||
|
// therefore keep the current viewDate and re-set it after datetimepicker is done hiding
|
||||||
|
var $dtp = $(this).data("DateTimePicker");
|
||||||
|
var currentViewDate = $dtp.viewDate();
|
||||||
|
window.setTimeout(function () {
|
||||||
|
$dtp.viewDate(currentViewDate);
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
if ($(this).parent().is('.splitdatetimerow')) {
|
if ($(this).parent().is('.splitdatetimerow')) {
|
||||||
$(this).on("dp.change", function (ev) {
|
$(this).on("dp.change", function (ev) {
|
||||||
var $timepicker = $(this).closest(".splitdatetimerow").find(".timepickerfield");
|
var $timepicker = $(this).closest(".splitdatetimerow").find(".timepickerfield");
|
||||||
|
|||||||
@@ -82,7 +82,15 @@ var form_handlers = function (el) {
|
|||||||
Math.abs(+new Date(opts.minDate) - new Date()) < Math.abs(+new Date(opts.maxDate) - new Date())
|
Math.abs(+new Date(opts.minDate) - new Date()) < Math.abs(+new Date(opts.maxDate) - new Date())
|
||||||
) ? opts.minDate : opts.maxDate;
|
) ? opts.minDate : opts.maxDate;
|
||||||
}
|
}
|
||||||
$(this).datetimepicker(opts);
|
$(this).datetimepicker(opts).on("dp.hide", function() {
|
||||||
|
// when min/max is used in datetimepicker, closing and re-opening the picker opens at the wrong date
|
||||||
|
// therefore keep the current viewDate and re-set it after datetimepicker is done hiding
|
||||||
|
var $dtp = $(this).data("DateTimePicker");
|
||||||
|
var currentViewDate = $dtp.viewDate();
|
||||||
|
window.setTimeout(function () {
|
||||||
|
$dtp.viewDate(currentViewDate);
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
if ($(this).parent().is('.splitdatetimerow')) {
|
if ($(this).parent().is('.splitdatetimerow')) {
|
||||||
$(this).on("dp.change", function (ev) {
|
$(this).on("dp.change", function (ev) {
|
||||||
var $timepicker = $(this).closest(".splitdatetimerow").find(".timepickerfield");
|
var $timepicker = $(this).closest(".splitdatetimerow").find(".timepickerfield");
|
||||||
|
|||||||
Reference in New Issue
Block a user