JavaScript implementation time Query

Source: Internet
Author: User

First of all to introduce JS files and CSS files

<script src= "Jquery-1.11.2.min.js" ></script><script src= "Bootstrap.min.js" ></script>< Script src= "moment.js" ></script><script src= "daterangepicker.js" ></script><link href= " Bootstrap.min.css "rel=" stylesheet "type=" Text/css "/><link href=" Daterangepicker-bs3.css "rel=" stylesheet " Type= "Text/css"/><link href= "Http://www.jq22.com/jquery/font-awesome.4.6.0.css" rel= "stylesheet" >

Here is the div section:

 <div class= "col-xs-12" ><!--Date Query component--<label class= "col-sm-1 Control-label TJ" > Release date: </                label> <div class= "Col-xs-4 TJ" > <form class= "form-horizontal" > <fieldset>  <div class= "Control-group" > <div class= "Controls" > <div                                class= "Input-prepend input-group" > <span class= "Add-on Input-group-addon" >                            <i class= "Glyphicon glyphicon-calendar fa Fa-calendar" ></i></span>                                   <input type= "text" readonly style= "width:200px" name= "Reservation" id= "Reservation"                class= "Form-control" value= "Please select query Date"/> </div> </div> </div> </fieldset> </form> </div></div> 

Finally, the JS section:

 <script type= "Text/javascript" >//Date Query JS component $ (document). Ready (function () {$ (' #reservation ') ). Daterangepicker (null, function (start, end, label) {Console.log (start.toisostring (), end.toisostring (), L            Abel);        });        });        var rqstart = "";        var rqend = "";                     DateTime method $ (document). Ready (function () {$ (' input[name= ' reservation "] '). Daterangepicker ({ /*format: ' Yyyy-mm-dd ', StartDate: ' 2013-01-01 ', endDate: ' 201 3-12-31 ' * *}, function (Start, end, label) {//alert (' A date range was Cho                    Sen: ' + start.format (' yyyy-mm-dd ') + ' to ' + end.format (' yyyy-mm-dd '));                    Start = Start.format (' yyyy-mm-dd ');//.format () converts any data into a string end = End.format (' yyyy-mm-dd ');                    /* Start at the end of add */Rqstart = start; Rqend = End;        }            );    }); </script>

The effect is as shown

JavaScript implementation time Query

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.