JS組件bootstrap-datepicker

1.引入css

 
 
<link rel="stylesheet" href="{% static "plugin/bootstrap-datepicker/css/bootstrap-datepicker.min.css" %}">


<
script src="{% static "plugin/bootstrap-datepicker/js/bootstrap-datepicker.min.js" %}"></script> <script src="{% static "plugin/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js" %}"></script>

 

2.初始化bootstrap

function initDataPicker() {
   $(
"#id_start_time,#id_end_time").datepicker({ format:"yyyy-mm-dd", startData:"0", language:"zh-CN", autoclose:true }); }
相關文章
相關標籤/搜索