fix datepicker appears out of screen (#2610)

This commit is contained in:
Kevin Papst
2021-06-10 15:51:26 +02:00
committed by GitHub
parent 7f20cb045c
commit 0b519e9d08
8 changed files with 25 additions and 4 deletions

View File

@@ -48,6 +48,13 @@ export default class KimaiDateTimePicker extends KimaiPlugin {
}
});
jQuery(this).on('show.daterangepicker', function (ev, picker) {
if (picker.element.offset().top - jQuery(window).scrollTop() + picker.container.outerHeight() + 30 > jQuery(window).height()) {
picker.drops = 'up';
picker.move();
}
});
jQuery(this).on('apply.daterangepicker', function(ev, picker) {
jQuery(this).val(picker.startDate.format(localeFormat));
jQuery(this).trigger("change");