2020-03-17 00:55:35 +08:00
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
$(document).on('click', '[data-toggle="date-time-picker"]', function(ev) {
|
|
|
|
ev.preventDefault();
|
|
|
|
ev.stopPropagation();
|
|
|
|
|
|
|
|
let dt = $(this);
|
2023-01-05 18:14:34 +08:00
|
|
|
let options = { ignoreReadonly: true };
|
2020-03-17 00:55:35 +08:00
|
|
|
|
|
|
|
if (dt.data('DateTimePicker')) {
|
|
|
|
dt.data('DateTimePicker').destroy();
|
|
|
|
}
|
|
|
|
|
2023-01-05 18:14:34 +08:00
|
|
|
if (dt.data('positioningVertical')) {
|
|
|
|
options.widgetPositioning = { vertical: dt.data('positioningVertical') };
|
|
|
|
}
|
|
|
|
|
|
|
|
dt.datetimepicker(options);
|
2020-03-17 00:55:35 +08:00
|
|
|
dt.data('DateTimePicker').show();
|
|
|
|
});
|
|
|
|
|
2022-12-02 18:01:40 +08:00
|
|
|
$(document).on('mousedown', '[data-toggle="clear-date-time-picker"]', function() {
|
2020-03-17 00:55:35 +08:00
|
|
|
let dt = $(`#${$(this).data('target')}`);
|
|
|
|
if (!dt.data('DateTimePicker')) dt.datetimepicker({ useCurrent: false });
|
|
|
|
dt.data('DateTimePicker').clear();
|
|
|
|
dt.val('');
|
|
|
|
});
|
|
|
|
}());
|