mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 18:21:04 +08:00
24 lines
636 B
JavaScript
24 lines
636 B
JavaScript
(function() {
|
|
'use strict';
|
|
|
|
$(document).on('click', '[data-toggle="date-time-picker"]', function(ev) {
|
|
ev.preventDefault();
|
|
ev.stopPropagation();
|
|
|
|
let dt = $(this);
|
|
|
|
if (dt.data('DateTimePicker')) {
|
|
dt.data('DateTimePicker').destroy();
|
|
}
|
|
|
|
dt.datetimepicker({ ignoreReadonly: true });
|
|
dt.data('DateTimePicker').show();
|
|
});
|
|
|
|
$(document).on('click', '[data-toggle="clear-date-time-picker"]', function() {
|
|
let dt = $(`#${$(this).data('target')}`);
|
|
if (!dt.data('DateTimePicker')) dt.datetimepicker({ useCurrent: false });
|
|
dt.data('DateTimePicker').clear();
|
|
dt.val('');
|
|
});
|
|
}());
|