This article mainly introduces how to use the js control bootstrapdatepicker, which has a certain reference value. Interested friends can refer to this article to introduce how to use the js control bootstrap datepicker, it has some reference value. If you are interested, you can refer
Bootstrap-datepicker sandbox environment:
Bootstrap-datepicker sandbox environment:
1. Configure requirejs
Requirejs. config ({baseUrl :'.. /pages/modules ', // urlArgs: "v =" + (new Date ()). getTime (), // disable caching. Remove urlArgs in the production environment: 'v = 2016110701 ', paths: {jquery :[".. /.. /plugins/jquery "], bootstrap :[".. /.. /plugins/bootstrap/dist/js/bootstrap. min "], datepicker :[".. /.. /plugins/bootstrap-datepicker/dist/js/bootstrap-datepicker.min "], datepicker_zh :[".. /.. /plugins/bootstrap-datepicker/dist/locales/bootstrap-datepicker.zh-CN.min "]}, shim: {bootstrap: {deps: [" jquery "], exports: 'bootstrap '}, datepicker: {deps: ["jquery"], exports: "datepicker"}, datepicker_zh: {deps: ["jquery", "datepicker"], exports: "datepicker_zh" }}); require (['jquery ', 'bootstrap']);
2 html
Date of birth:
3. js
var $ = require('jquery');require('datepicker_zh');$("#birthdayGroup .input-group.date").datepicker({todayHighlight:true,todayBtn: 'linked' ,keyboardNavigation:true,autoclose:true,language:'zh-CN',format:'yyyy-mm-dd' ,daysOfWeekHighlighted:'0,6'});
4. Effect
Warehouse Receiving date:
To
The js configuration is relatively simple. You can configure it during initialization.
$(".input-daterange").datepicker({keyboardNavigation:!1,forceParse:!1,autoclose:!0});
From the instance, we can see that there is a selected date in the calendar, and the size of the two dates before and after is completed by the control itself, no human operation is required.
The above is a detailed description of how to use the JS control bootstrap datepicker (Figure). For more information, see other related articles in the first PHP community!