如何从初始化的 Bootstrap 日期选择器中获取日期格式?
How can I get the date format from an initialized Bootstrap datepicker?
我有以下 bootstrap 日期选择器:
<input type="dtpicker" id="abc" name="abc" value="26-05-2022">
$('input[type="dtpicker"]').datepicker({
format: "dd/mm/yyyy",
clearBtn: true,
autoclose: true,
orientation: "bottom right",
autoUpdateInput: true
});
如何通过代码(Javascript 或 jQuery)获得“格式”选项?
一般来说,如何获得日期选择器选项?
$(element).data().datepicker.o.format
参见How to access properties and functions of a jQuery plugin。
我有以下 bootstrap 日期选择器:
<input type="dtpicker" id="abc" name="abc" value="26-05-2022">
$('input[type="dtpicker"]').datepicker({
format: "dd/mm/yyyy",
clearBtn: true,
autoclose: true,
orientation: "bottom right",
autoUpdateInput: true
});
如何通过代码(Javascript 或 jQuery)获得“格式”选项?
一般来说,如何获得日期选择器选项?
$(element).data().datepicker.o.format
参见How to access properties and functions of a jQuery plugin。