Date picker: Guess default time 23:59 for end dates (Z#23182900) (#4917)

* Date picker: Guess default time 23:59 for end dates (Z#23182900)

* Update src/pretix/static/pretixcontrol/js/ui/main.js

Co-authored-by: luelista <weller@rami.io>

* Update src/pretix/static/pretixpresale/js/ui/main.js

Co-authored-by: luelista <weller@rami.io>

---------

Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
Raphael Michel
2025-03-27 11:04:02 +01:00
committed by GitHub
parent 592b98b83a
commit 42399c3488
2 changed files with 10 additions and 2 deletions

View File

@@ -205,7 +205,11 @@ var form_handlers = function (el) {
return;
}
if ($timepicker.val() === "") {
date.set({'hour': 0, 'minute': 0, 'second': 0});
if (/_(until|end|to)(_|$)/.test($(this).attr("name"))) {
date.set({'hour': 23, 'minute': 59, 'second': 59});
} else {
date.set({'hour': 0, 'minute': 0, 'second': 0});
}
$timepicker.data('DateTimePicker').date(date);
}
});

View File

@@ -91,7 +91,11 @@ var form_handlers = function (el) {
return;
}
if ($timepicker.val() === "") {
date.set({'hour': 0, 'minute': 0, 'second': 0});
if (/_(until|end|to)(_|$)/.test($(this).attr("name"))) {
date.set({'hour': 23, 'minute': 59, 'second': 59});
} else {
date.set({'hour': 0, 'minute': 0, 'second': 0});
}
$timepicker.data('DateTimePicker').date(date);
}
});