|
|
@ -98,8 +98,16 @@ $(function () {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$(function () {
|
|
|
|
$(function () {
|
|
|
|
$([
|
|
|
|
$([
|
|
|
|
{'select': $('.input-group.date'), 'format': 'YYYY-MM-DD'},
|
|
|
|
{
|
|
|
|
{'select': $('.input-group.datetime'), 'format': 'YYYY-MM-DD HH:mm'},
|
|
|
|
'select': $('.input-group.date'),
|
|
|
|
|
|
|
|
'format': 'YYYY-MM-DD',
|
|
|
|
|
|
|
|
'extraFormats': []
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'select': $('.input-group.datetime'),
|
|
|
|
|
|
|
|
'format': 'YYYY-MM-DD HH:mm',
|
|
|
|
|
|
|
|
'extraFormats': ['YYYY-MM-DDTHH:mm']
|
|
|
|
|
|
|
|
},
|
|
|
|
]).each(function (_, element) {
|
|
|
|
]).each(function (_, element) {
|
|
|
|
element.select.each(function () {
|
|
|
|
element.select.each(function () {
|
|
|
|
var elem = $(this);
|
|
|
|
var elem = $(this);
|
|
|
@ -108,6 +116,7 @@ $(function () {
|
|
|
|
maxDate: '',
|
|
|
|
maxDate: '',
|
|
|
|
locale: $('html').attr('lang'),
|
|
|
|
locale: $('html').attr('lang'),
|
|
|
|
format: element.format,
|
|
|
|
format: element.format,
|
|
|
|
|
|
|
|
extraFormats: element.extraFormats,
|
|
|
|
widgetPositioning: {horizontal: 'auto', vertical: 'bottom'},
|
|
|
|
widgetPositioning: {horizontal: 'auto', vertical: 'bottom'},
|
|
|
|
icons: {
|
|
|
|
icons: {
|
|
|
|
time: 'bi bi-clock',
|
|
|
|
time: 'bi bi-clock',
|
|
|
@ -116,29 +125,29 @@ $(function () {
|
|
|
|
down: 'bi bi-arrow-down'
|
|
|
|
down: 'bi bi-arrow-down'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$.extend(opts, elem.data());
|
|
|
|
$.extend(opts, elem.data());
|
|
|
|
|
|
|
|
|
|
|
|
if (opts.minDate.length === 0) {
|
|
|
|
if (opts.minDate.length === 0) {
|
|
|
|
delete opts.minDate;
|
|
|
|
delete opts.minDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (opts.maxDate.length === 0) {
|
|
|
|
if (opts.maxDate.length === 0) {
|
|
|
|
delete opts.maxDate;
|
|
|
|
delete opts.maxDate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
elem.children('input').attr('type', 'text');
|
|
|
|
elem.children('input').attr('type', 'text');
|
|
|
|
elem.children().on('click', function (ev) {
|
|
|
|
|
|
|
|
ev.stopImmediatePropagation();
|
|
|
|
|
|
|
|
if (typeof elem.data('datetimepicker') === 'undefined') {
|
|
|
|
|
|
|
|
elem.datetimepicker(opts);
|
|
|
|
elem.datetimepicker(opts);
|
|
|
|
elem.data('datetimepicker').show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// close on click anywhere outside
|
|
|
|
// close on click anywhere outside
|
|
|
|
$(document).on('click', () => {
|
|
|
|
$(document).on('click', () => {
|
|
|
|
elem.data('datetimepicker').hide()
|
|
|
|
elem.data('datetimepicker').hide()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
elem.children().on('click', (ev) => {
|
|
|
|
|
|
|
|
ev.stopImmediatePropagation();
|
|
|
|
elem.data('datetimepicker').toggle();
|
|
|
|
elem.data('datetimepicker').toggle();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|