Describes how to use the JS control bootstrapdatepicker (figure)

Source: Internet
Author: User
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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.