1 回答

TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超18個(gè)贊
最后,這是我的解決方案:
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'],
])
希望對(duì)其他開(kāi)發(fā)者有所幫助!
添加回答
舉報(bào)