[英]Bootstrap4 tempus dominus DateTimePicker doesn't show up
I followed this , and there is no error message but the datetimepicker doesn't appear on the input element.我跟着这个,没有错误消息,但 datetimepicker 没有出现在输入元素上。
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="/html/template/default/assets/js/function.js"></script>
<script src="/html/template/admin/assets/js/vendor/moment.min.js"></script>
<script src="/html/template/admin/assets/js/vendor/moment-with-locales.min.js"></script>
<script src="/html/template/admin/assets/js/vendor/tempusdominus-bootstrap-4.min.js"></script>
<script>
$(function () {
$('input.datetimepicker-input').datetimepicker({
locale: 'ja',
format: 'YYYY-MM-DD HH:mm:ss',
useCurrent: true,
buttons: {
showToday: true,
showClose: true
},
});
});
</script>
<input type="text" id="shopping_order_time" name="_shopping_order[time]" required="required" class="datetimepicker-input" data-target="#shoppingtakeout_time" data-toggle="datetimepicker">
If someone has any idea about what is causing the problem could you please help?如果有人知道导致问题的原因,您能帮忙吗?
The problem was that the value of the data-target was not the element's id.问题是 data-target 的值不是元素的 id。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.