1 回答
TA贡献1853条经验 获得超18个赞
最后,这是我的解决方案:
css:
< link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.css" rel="stylesheet"/>
JS
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.js"></script>
<script>
$(document).ready(function() {
// you may need to change this code if you are not using Bootstrap Datepicker
$('.js-datepicker').datepicker({
format: 'yyyy-mm-dd'
});
});
</script>
表格类型
->add('date_entree', DateType::class, [
'widget' => 'single_text',
'html5' => false,
'attr' => ['class' => 'js-datepicker'],
])
希望对其他开发者有所帮助!
添加回答
举报